Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a list of all values of a dropdown field using jira rest api or jql

Shilpy Rana July 20, 2023

I want to get the list of all the values of a dropdown field using jql. 

For example - There is a dropdown field 'A' having options 1,2,3 then in the response of my query or api I want the list(or a json response having all the values) - [1,2,3]

Additional Info - 
I do not have admin rights 

1 answer

1 accepted

2 votes
Answer accepted
Charlie Misonne
Community Champion
July 20, 2023

Try this API endpoint:

Option 1

https://<your-tenant>.atlassian.net/rest/api/2/jql/autocompletedata/suggestions?fieldName=<field name>

It will return the list of possible values for the field. These are the same values you'll see in the JQL autocomplete suggestions.

Documentation on https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-jql/#api-rest-api-2-jql-autocompletedata-suggestions-get

Option 2

This is probably easier. But if you are not an admin you'll only see the options for the project you have access too, which is probably enough for you.

https://<your-tenant>/rest/api/2/customFieldOption/<field ID>

Documentation: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-custom-field-options/#api-rest-api-2-customfieldoption-id-get

Shilpy Rana July 20, 2023

Thankyou so much for your reply!

Option 1 worked for me and I am getting the required output.

For Option 2, I was getting 404, I was using the customfield_XXXXX type of id, as <field ID> is it correct or did I do something wrong?

Charlie Misonne
Community Champion
July 25, 2023

I'm sorry, option 2 is not valid.

I was confused but it only returns 1 option of the custom field where the ID is the ID of the option. So not what you are looking for.

I guess you'll have to go with option 1 :-)

Shilpy Rana September 26, 2023

option 1 is not giving the full list, do I need to give some other parameter to get full list

Like wouter de wit likes this
Dharmraj Chauhan January 21, 2024

Hello @Shilpy Rana and @Charlie Misonne 

Is there any update on how to get all options list?

Thanks, 
Raaj

Mohit Bansal
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!
March 19, 2024

Did anyone find a way to get entire list of options ?

shantanuw August 5, 2024

@Charlie Misonne Hey!

Only getting a partial list of 15 values using Option #1 above. Is there any param which can be used to increase the # of values being fetched?

Like wouter de wit likes this
Charlie Misonne
Community Champion
August 19, 2024

I don't see a parameter to get more than 15 values in the documentation.

I think JQL autocomplete will not show more than that in the UI. Other results will show up when typing something.

This solution seems even less ideal than I thought.

Like wouter de wit likes this

Suggest an answer

Log in or Sign up to answer