JIRA Rest API: How to get all options of a custom field?

2,411 views
Skip to first unread message

Matthias Gaiser (K15t Software)

unread,
Mar 1, 2016, 10:20:27 PM3/1/16
to Atlassian Connect Dev
Dear all,

I want to access all the options of a custom field (multi-select, single-select, etc.) via the JIRA REST API.
I am aware that there are two possibilities how to get them:
  • createMeta: Delivers all options of the custom field, if it exists on the create screen.
  • editMeta: Needs an existing issue and delivers all options of the custom field, if it is on the edit screen.
I am searching for a third option that I get all the options of a custom field (in a project context) independently if they are on a create or edit screen.
Any hints?

Thank you,
Matthias.

Marek Pazik

unread,
Mar 2, 2016, 12:00:46 PM3/2/16
to Atlassian Connect Dev
Hi Matthias,

CreateMeta resource with expand=projects.issuetypes.fields param should return you all possible options. Field options depend only on project and issue type (not on the screen). If issue types are not specified then all possible options for each issue type for the given project are returned.
That is the case for all built-in JIRA field types; However plugins may provide custom field types with may behave differently and returns different set of options for different issues.
Let me know if that helps you.

Best Regards,
Marek

Matthias Gaiser (K15t Software)

unread,
Mar 3, 2016, 10:48:45 AM3/3/16
to Atlassian Connect Dev
Hi Marek,

thank you for your response. The CreateMeta resource works really fine for all fields on the create screen. But if a field is not on the create screen, it is (obviously) not included in the CreateMeta response and therefore I also cannot retrieve the options.
I somehow get the desired response if I (mis)use the autocompletedata/suggestions endpoint and provide the fieldName I want to and an empty string as a field value, but this solution is kind of hacky. Any other hints?

Best wishes,
Matthias.

Marek Pazik

unread,
Mar 4, 2016, 6:23:28 AM3/4/16
to Atlassian Connect Dev
Hi Matthias,
That's true. Sorry, I understood that you thought that there may be different options for different screens.
Unfortunately currently there is no possibility to get all options for fields available only on the edit screen. However we will start work on the new REST API for editing issues soon and we will keep in mind your use-case.

Best regards,
Marek
Reply all
Reply to author
Forward
0 new messages