JIRA API GET all values for a custom field

Gustavo Nunes Batista August 16, 2018

I'm trying to get all possible values for a customfield on JIRA through the GET api.

Example:

I created the "Test API" custom field and gave it three values "API 1", "API 2" and "API 3". The id for this field is 18232.

I'm trying to do this with the following:

https://my-domain.atlassian.net/rest/api/2/customFieldOption/18232

I got this from here

The headers are one for basic authorization and one with Accept - application/json

No matter what I try to do I keep getting the error

{"errorMessages":["A custom field option with id '18232' does not exist"],"errors":{}}

Has anyone been sucessful with this?

1 answer

7 votes
Jobin Kuruvilla [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.
August 16, 2018

This is returning a specific option details and should work if the option id is correct.

If you want to get all the allowed values for a custom field, use the createmeta or editmeta methods. Here is an example resource:

/rest/api/2/issue/createmeta?projectKeys=YOURPROJECTKEY&issuetypeNames=Bug&expand=projects.issuetypes.fields

carl_meyrick
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 10, 2019

Thanks, you solved my issue :)

Like Max Makhrov likes this
Max Makhrov
Contributor
March 18, 2019

Jobin Kuruvilla, thank you! 

This solved my issue partially:

/rest/api/2/issue/createmeta?projectKeys=YOURPROJECTKEY&expand=projects.issuetypes.fields

I've got all the possible values for my custom field.

My other field has a child:

type=option-with-child

The method showed above gives me all values for the main field — parent. I was not able to retrieve all values for the child. Could you please say if it possible?

Sundareswaran K April 8, 2021

Thank you! this works.

Support REST Extender _Groupnet_ October 14, 2021

The upper REST call is meanwhile marked as deprecated in the REST API reference guide. To get the custom field options in the future, get first all issue types of one project:

GET /rest/api/2/issue/createmeta/{projectKey}/issuetypes

then for one specific issue type {id} the field details:

GET /rest/api/2/issue/createmeta/{projectKey}/issuetypes/{id}

The result contains the custom filed options underneath "allowedValues", if present for this issue type.

Like # people like this
Appendix19
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 16, 2024

@Support REST Extender _Groupnet_Thank you kind sir, I was searching for this way too long, but your wisdom saved me from damnation.

Suggest an answer

Log in or Sign up to answer