Apply filter from custom plugin onto dashboard is not working in 7.9.3

Hi,

I am trying to apply filter from custom plugin on to dashboard. It used to work with belowcode snippet with old version. Now I am migrating my plugin to 7.9.3. As soon as I apply filter using below code the filter is disabled and it is triggering "_bulk_get" api on saved_objects and it is giving me this error :

     http://localhost:5601/api/saved_objects/_bulk_get
        error: "Bad Request"
        message: "[request body.0.id]: expected value of type [string] but got [Object]"
        statusCode: 400 

I am applying filter using below code:

    filterManager.addFilters([
          {
            terms: {
              ids: ["ABC", "DEF"],
            },
            meta: {
              index: "my-index-id",
              disabled: false,
              type: 'custom',
              key: 'custom',
              value: ["ABC", "DEF"],
              negate: false,
              alias: "my-custom-label",
            }
          },
        ]);

I am wondering if this is the correct way of applying filters. Could somebody help?

Thanks,
Krishna.

Hi @nrt.krishna,

Do you mind providing the request's body that is sent to /api/saved_objects/_bulk_get?

Thank you!

@afharo Sorry for the late reply. I actually solved it by removing index from meta

1 Like