How to get a list of all JIRA fields?

Petya Tsvetanova Petrova March 3, 2013

Hi,

I develop an importer from another bug-tracking system. However, this other system has a lot of different custom fields and I want to let the users decide how to map their fields, to the existing JIRA fields, instead of writting a lot of special cases... How can I do that?

Thanks,

Petya

4 answers

1 accepted

4 votes
Answer accepted
RambanamP
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.
March 5, 2013
use the following api to get all the fields
fieldManager.getAllAvailableNavigableFields()

Petya Tsvetanova Petrova March 18, 2013

I've got all available fields by:

ComponentAccessor.getFieldManager().getAllAvailableNavigableFields()

1 vote
Pawel Niewiadomski
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.
March 3, 2013

If you want to get a list of all custom fields defined in JIRA use CustomFieldManager.getCustomFieldObjects. Check also other methods there.

Petya Tsvetanova Petrova March 7, 2013

That way I can get only the custom fields, right? I need all Issue fields.

RambanamP
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.
March 7, 2013

did you tried with my answer?

Petya Tsvetanova Petrova March 10, 2013

Yes, but I didn't succeed. I don't know where to call that function.

Like # people like this
0 votes
Akhil Agarwal August 7, 2019

Hi,

I am stuck at the same thing. Did you find the solution??

0 votes
John Bishop
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.
March 10, 2013

If your importer is an application outside of Jira, you can use Jira's REST API (http://docs.atlassian.com/jira/REST/5.0/#id199677) to get all the custom fields for an issue. Then once you have the mapping figured out, you can also use the REST api to create issues and set custom field values.

Petya Tsvetanova Petrova March 10, 2013

My plugin is a part of your JIRA importer plugin and I need all of the standard fields as well as the custom ones. Some of the fields from Savannah could be mapped to standard JIRA fields. No need to create custom fields in that case, right?

Suggest an answer

Log in or Sign up to answer