How to search for assets for a custom field?

Hi,

I’m looking for a way to get a list of possible values for an asset custom field which has a filter applied to it.

If I add an asset custom field (with a configured filter) to an issue and start typing into the search box, I see network traffic in my browser with a request going to /rest/assetapi/asset/search?prioritizedAssignee=…&type={appKey}/{originId}&query=some_query_string and a list of matching assets being returned.

How can I get the type value for an asset custom field so that I can query the Jira Asset API in the same way that the Jira UI does? I know the type value is constructed from {appKey}/{originId} but I don’t see any Jira API that can provide those values for an asset custom field?

NB: If an asset custom field doesn’t have a filter associated with it, then the type parameter can be ignored, but if it does have a filter, then the appKey and originId values are needed to construct the type query parameter.

I see that there is a Connect module for an assets issue panel, but that doesn’t provide the information in a suitable way to access it.

None of the regular Jira issue or field API’s seem to provide this information:

/rest/api/3/field/search
/rest/api/3/issue/{issue}
/rest/api/3/customField/{fieldId}/option

Is there a Jira API that can provide it?

Regards,
Robert.

Hi @robertc
If this is still relevant, I think the API you are looking for is https://developer.atlassian.com/cloud/assetsapi/rest/intro/
Alex

1 Like