Use metadata as filter in Search

Hi,

I have created a metadata attribute “roleTypeOfRole” that has three possible values: systemRole, businessRole and coreRole.
I have assigned all roles in ISC one of these values and can see from the overview list of roles that the value is present on each role.

But when I go to Search view and try to search for all roles with a certain typeOfRole value I get no results.

Query looks like this:
@accessModelMetadata(key:“roleTypeOfRole” AND value:“systemRole”)

Why is that? Is my search query incorrect?
Is there a delay between adding metadata on roles and when search view can see the value linked to the role?

To search for roles using custom metadata attributes in IdentityNow, you can use the “Filter roles by metadata” endpoint. This endpoint allows you to search roles based on their metadata attributes. The HTTP request for this operation is a POST request to /roles/filter.

Here’s how you can use it:

  1. Construct the API endpoint: https://{tenant}.api.sailpoint.com/v2024/roles/filter search-roles-by-filter | SailPoint Developer Community

  2. Use the POST method

  3. Include the necessary headers:

    • ‘Accept: application/json’

    • 'Authorization: Bearer ’

  4. In the request body, you can specify the metadata attributes you want to filter by

This method allows you to search for roles based on their custom metadata attributes, providing a powerful way to find roles that match specific criteria. Regarding the delay in indexing new metadata for search, the search results do not provide specific information about indexing delays for new metadata. However, it’s generally a good practice to allow some time for new metadata to be indexed and become searchable after it has been added or modified. The exact delay can vary depending on the system’s configuration and load.

If you’ve recently added or modified metadata and it’s not appearing in search results, you may want to wait a short period and try again.

I’m talking about using Search view in the GUI, not the API.

Yeah, I understand. However, I tried the query:

@accessModelMetadata(key:“name”) AND @accessModelMetadata(value:“name”)

and didn’t get any results in the Search view. Interestingly, I was able to retrieve the expected results through the API.

I’m assuming it might take some time for the update to reflect in Search, so I’m waiting to see if it syncs after a while.

Thanks!

Yeah, it’s taking some time for the update to reflect in Search. It’s working actually, and also the query you are using is correct.

It’s working on some delay.

Thanks!

1 Like

Try this instead
accessModelMetadata.key: “roleTypeOfRole” AND accessModelMetadata.value: “systemRole”

It worked with the following:

@accessModelMetadata(value:businessRole)

But the original search also works now so it was probably a delay.