How can I get custom fields labels and respective custom fields IDs in list

Kaushik Patel April 21, 2021

I want a list of all custom fields and their respective IDs configured in my JIRA.

I know how to get ID of a custom field by hovering cursor over the custom  field label, but I need the list of all such custom fields with their IDs.

Is there any query I can use? I have scriptRunner available, but don't know how to use the query for it.

Is there a way I can have this information by Export?

Thanks,

Kaushik.

3 answers

1 accepted

4 votes
Answer accepted
Max Lim _Adaptavist_
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 22, 2021

If you just want this information in text (json), you can request this url:

http://yourbaseurl/rest/api/2/field

This will return all fields information.

 

You can also programmatically query this information using Jira API. Run this script in ScriptRunner > Console:

import com.atlassian.jira.component.ComponentAccessor

ComponentAccessor.getCustomFieldManager().getCustomFieldObjects().collect {
it.name + ":" + it.id
}

 

I hope this helps!

Kaushik Patel April 22, 2021

Yes, this helped. I ran in ScriptRunner > Console

Thank you.

1 vote
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 21, 2021

Hi @Kaushik Patel  - You can probably do that using something like Postman and access it through the API. But that's not my area or ability. Maybe someone else can provide more details or you can search the API. 

0 votes
Muhammad Akram Sharifi April 21, 2021

Hi @kaushik

As @John Funk  mentioned the best way is to use postman.

Suggest an answer

Log in or Sign up to answer