How do you get custom field labels from API for JIRA issues?

Jessica Malenfant July 7, 2017

Pulling the names for JIRA custom fields: from API instead of the ID: Wondering if there is an easy or programmatic way (that is less prone to error & is scalable as new custom fields are added) to pull the names for custom fields in an API call.

We're using the BI tool Qlik Sense for building analytic dashboards to publish in Confluence pages.  Like many people, we have custom fields in JIRA. We're trying to use 2 API calls with the Qlik Sense rest connector to get the:

1. issues from a specific JIRA filter

2. custom fields names for these issues - https://ourprojectname.atlassian.net/rest/api/latest/field/

We're having problems trying to create a simple table with JIRA issues and columns that display the actual name for a custom field, not the ID.

 

Any thoughts on this? I'm guessing this is a common issue. There must be something easier than manually matching names with IDs.
Thanks!!

 

3 answers

11 votes
Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 2, 2017

Hi Jessica,

you can get the field names by adding an expand parameter to your search call. Assuming you use this endpoint, you can simply add "expand=names" to it. This gives you the list of names in the response as well. You can try e.g:

https://k15t.jira.com/rest/api/2/search?maxResults=1&expand=names

You still have to map the field ids to get the name, but you have it in one call.

Cheers,

Matthias.

2 votes
somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 27, 2017

Hi Jessica,

The following provides a lot more information than you need, however, it will provide the custom field's name and you would just need to search/filter out the name of your custom field:

http://localhost:8080/rest/api/latest/issue/createmeta?projectKeys=BSM&expand=projects.issuetypes.fields

Cheers,

Branden

0 votes
Taryck BENSIALI August 2, 2017

For me there is no way to do that in one call. This is, I guess, related to the way custom fields data is stored.
But custom fields doesn't change after been created... so ID won't change a lot. How ever they could be different in development system than in productive system (do a copy to sync them).


On a projet I've created a call to get custom fields correspondance and I do mapping. In my application I use custom fields names (view by the user) and in my calls I automaticaly switch them to the technical ugly field names...

 

I don't think this will helps you a lot because you a bound to a devlopment framework within BI tool Qlik Sense...
That's why we build reportings at Database level which is a little by more intrusive but very efficent and allow user to have interactive reports for free on Excel for instance....

Suggest an answer

Log in or Sign up to answer