I know that in cloud this task is very easy to do, but there are any way I can get this info in Jira Server API? There’s only a screensCount property in the custom fields endpoint…
Welcome to the Atlassian Developer Community, @EduardoNunes!
In my experience, I have not found a single Jira Server REST API call to return this value. However, there is an approach to do this but would require a number of calls by starting the journey from screens.
- Get all screens (
GET /rest/api/2/screens
) - Iterate over the screen IDs to get all tabs (
GET /rest/api/2/screens/{screenId}/tabs
) - Use the
screenId
andtabId
pairs to get all the fields for that tab (GET /rest/api/2/screens/{screenId}/tabs/{tabId}/fields
) which should return something like
[
{
"id": "summary",
"name": "Summary",
"type": "System field"
},
{
"id": "issuetype",
"name": "Issue Type",
"type": "System field"
},
...
{
"id": "customfield_10000",
"name": "Test Label Manager",
"type": "Label Manager"
},
{
"id": "customfield_10100",
"name": "Test Select List",
"type": "Select List (single choice)"
}
]
From the data that you have - screenId
, tabId
, and a list of fields from a specific tab - you can then map a custom field to specific screens.
Hope this helps.
Ian