Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

REST API - Retrieving field configuration for an issue type (next-gen project)

Romain Viallard___ April 8, 2021

Hi,

I'm wondering if it's possible to get the list of fields linked to a specific issue type when using the REST API v3 with next-gen projects.

My use case is the following (configured through JIRA interface):

- 2 issues type A and B

- 2 custom fields C and D

- field C should be displayed on issue type A only

- field D should be displayed on issue type B only

 

Is the information related to the link between A and C available somewhere in the API ?

I know this is using issue type screen schemes when in classic projects but could not find how to do it with next-gen ones

1 answer

1 accepted

2 votes
Answer accepted
Prince Nyeche
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.
April 8, 2021

Hi @Romain Viallard___ 

I don't think the next-gen project has an exposed API simply for this, so what you might be thinking might not even be possible to do directly. However, there's always a workaround if you can combine multiple endpoints. To list all field, I believe you can do this by using the /rest/api/3/project/search endpoint parse out the field "style":"next-gen" to identify next-gen only project and grab the projectId from the payload. Then use the project id to find the issuetype on /rest/api/3/issuetype to know all the issuetype added to it and grab the issuetype id. Then lastly search the issue endpoint as you've already gotten the projects identified as next-gen, so you can know which project key it is. In that search, run through every issue filtering the issues by issuetype id and only check the issue if the issuetype are identified. At this point, you can then find the fields within a next-gen issue and probably store this information in a file and get that list that you're searching for.

Romain Viallard___ April 8, 2021

Thanks for your help here Prince !

That's a bit unfortunate since I'll have to wait for issue of a specific type to be created to get the schema but that's an acceptable workaround for now.

Suggest an answer

Log in or Sign up to answer