Get possible values for an Insight custom field through REST API

Georgi Gachev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 22, 2022

Hi guys,

I'm trying to get all possible Insight objects (I need the label but once I get the object Ids, I can get them from there) that are tied to a custom field on Jira Cloud through my Connect AddOn using REST API. I believe if I find the schema ID that would be enough to continue from there but I can't find a place where I can get the connection between the custom field and the Insight schema. I'm looking at this documentation The Insight REST API (atlassian.com)

Another option could be using a REST call with an IQL query to get the results but I'm still not sure how to do that.

Any help or advice would be appreciated.

Thanks,
Georgi

1 answer

1 accepted

0 votes
Answer accepted
Georgi Gachev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 25, 2022

I managed to work it out by using the REST for search and using iqlFunction to search for all issues that have a value set (with a label) for the Insight field (cf 10129). I also have to include the cmdb.label for the custom field in the expand clause and I also limit the returned fields to only this one. Afterwards I can get all label values from inside:


rest/api/3/search?jql=project = 10000 and cf[10129] in iqlFunction("label is not empty")&expand=customfield_10129.cmdb.label&fields=customfield_10129

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events