I am trying to get a list of the possible options for each dropdown menu in a custom field.
I am able to get it for some fields but not others. For example, we have a field "Priority", and I can get the info about it as described in this thread:
https://confluence.atlassian.com/jirakb/how-to-retrieve-available-options-for-a-multi-select-customfield-via-jira-rest-api-815566715.html
In this first example, I can successfully retrieve info about the field called "priority"
james@Q35~ $ curl -H "Authorization: Basic $TOKEN" -X GET -H "Content-Type: application/json" https://ourdomain.atlassian.net/rest/api/2/priority
[{"self":"https://ourdomain.atlassian.net/rest/api/2/priority/1","statusColor":"#cc0000","description":"Blocks development and/or testing work, production could not run.","iconUrl":"https://ourdomain.atlassian.net/images/icons/priorities/blocker.svg","name":"Blocker","id":"1"},{"self":"https://ourdomain.atlassian.net/rest/api/2/priority/2","statusColor":"#ff0000","description":"Crashes, loss of data, severe memory leak.","iconUrl":"https://ourdomain.atlassian.net/images/icons/priorities/critical.svg","name":"Critical","id":"2"},{"self":"https://ourdomain.atlassian.net/rest/api/2/priority/3","statusColor":"#009900","description":"Major loss of function.","iconUrl":"https://ourdomain.atlassian.net/images/icons/priorities/major.svg","name":"Major","id":"3"},{"self":"https://ourdomain.atlassian.net/rest/api/2/priority/4","statusColor":"#006600","description":"Minor loss of function, or other problem where easy workaround is present.","iconUrl":"https://ourdomain.atlassian.net/images/icons/priorities/minor.svg","name":"Minor","id":"4"},{"self":"https://ourdomain.atlassian.net/rest/api/2/priority/5","statusColor":"#003300","description":"Cosmetic problem like misspelt words or misaligned text.","iconUrl":"https://ourdomain.atlassian.net/images/icons/priorities/trivial.svg","name":"Trivial","id":"5"}]
on the other hand, a field called "assignee", which also has a dropdown menu, returns a 404. I was hoping it would return a list of employee names, as appears in the `assignee` dropdown menu
james@Q35~$ curl -H "Authorization: Basic $TOKEN" -X GET -H "Content-Type: application/json" https://ourdomain.atlassian.net/rest/api/2/assignee
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>404</status-code><message>null for uri: https://ourdomain.atlassian.net/rest/api/2/assignee</message></status>
Any ideas about why the URL schema works for some fields but not others? And more importantly what might I try to get the info about these other fields?
Hi @James_Hanks
Welcome to the Atlassian Community. It can be daunting when you start at the amount of information available (and sometimes conflicting) to find the answers to what may appear a simple question.
Let me unpick some of the complexities in your question to help you understand.
1. The API you reference is version 2 which was deprecated some time ago and the current version (15 may 2020) is https://developer.atlassian.com/cloud/jira/platform/rest/v3/
2. Jira has a number of different fields - standard and custom. Some standard fields such as Priority are available by using the request such as
https://your-domain.atlassian.net/rest/api/3/priority/
Others such as issue type, issue resolutions etc are also available.
3. Users are an area where there was significant changes announced in https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/ which impacts what you are trying to do in terms of retrieving personal data.
The API call to get information of users is https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-user-get
but beware for a particular project/issue you will need to check whether that person has appropriate permissions/membership of groups/roles etc to see if they can be an assignee for a particular issue. Which can get quite complex depending on the configuration of the project.
For completeness and not directly answering your question Customfields are covered with the API call https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-customField-fieldId-option-get
I hope this helps you understand a little more about what you are asking.
Phill
I know bumping is bad, but I could really use some help here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.