Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,457,864
Community Members
 
Community Events
176
Community Groups

How to get Insight custom fields with its objects from API?

Hi there.

Is there a way to get the Insight custom fields from my Jira's instance API with its objects according to their object schema?

E.g. I have the following Insight custom field named test and when I'm creating a new issue I can see all the objects available according the Object Schema that I selected in the configuration:

Screenshot from 2021-08-30 13-08-52.png

Is there a way to get this information (the Insight custom fields with its objects) from the API? I know that I can get all the objects from a specific schema by using the endpoint /iql/objects?iql=objectSchema="SCHEMA", but what I want to get is the custom fields with its objects.

 

Just in case, I'm using the following endpoint to get all the others custom fields from my instance: 

/rest/api/2/issue/createmeta?expand=projects.issuetypes.fields

If a custom field has multiple values to choose, it will show me the field "allowedValues" with the values for the custom field, but this doesn't happen when it's an Insight custom field.

Can you guys give me a hand with this?

 

2 answers

Hey guys,

Did you manage to find a way to do that? Or maybe there is something available right now, I tried searching for a solution but I couldn't find anything.

I need the same thing - I have a custom field that is using Insight and I would like to use REST calls to get the possible values (objects)?

Thanks,
Georgi

0 votes

That's an interesting question.

It's possible that the IQL defined in the custom field context is only used for building the UI and not validated at all in the back end. This might imply Jira API will allow you to input any object via the rest API. I'm not even sure if the object key is validated to make sure it is valid.

But that still leaves you not knowing what are the possible values.

I checked and I can't find any public insight or Jira rest API that can give you the configuration for a custom field context (that would let you get the IQL so you could use the main insight API to get the list of objects).

I can find an internal insight API that can return the IQL, but you would first need to identify the correct config id for the issue context (project and issue type). But there are no public APIs for that either. 

The insight internal API is:

/rest/insight/1.0/customfield/default/<custom field context id>/connect

If you have Scriptrunner, you could create a custom Rest API that can use the JavaAPI to get this information.

Hey, thanks for your help! It's a shame that this is not possible. Do you know if this feature will be added someday?

No clue. I'm just a user like you. Not in any Atlassian inner circle.

You might want to make a feature request.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events