Rest api to update the options for custom dropdown field in a team managed project

Buzz
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 9, 2024

Hi,

Im trying to populate programmatically a dropdown custom field options via the REST API in a team managed project (previously next gen project).

I was unable to make it work for a team managed project. I made it work for a global custom field.

Im working of this endpoint: 

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-options/#api-rest-api-3-field-fieldid-context-contextid-option-post

I'm not sure which context id to use when using a team managed custom field. I tried using "default" as the context id but that doesnt work and i get status code 400.

I tried fetching the context using /rest/api/3/field/{fieldId}/context. but it says field not found. My assumption is that these APIs are for global custom fields and not for team managed projects.

The below api request is working for a global custom field -  i was able to find the context id via the UI. However, im not sure what is the context id for team managed project

 

curl -v -XPOST -u 'username:token' -H 'Accept: application/json' -H "Content-type: application/json" -d '{

"options": [

{

"disabled": false,

"value": "Scranton"

},

{

"disabled": true,

"value": "Manhattan"

},

{

"disabled": false,

"value": "The Electric City"

}

]

}' 'https://myjira.com/rest/api/3/field/customfield_10146/context/13150/option'

Thank you!

1 answer

0 votes
Thomas Opiolka - codefortynine
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.
September 12, 2024

Hi Buzz,

for the app External Data for Jira Fields we use those endpoints in the Field Options Sync configuration.

In our comparison matrix, we note that team-managed fields cannot be directly targeted, and we suggest using global custom fields as a workaround.

Your perception that these API endpoints are only for global custom fields aligns with our view, although this detail isn’t explicitly documented at the endpoint level.

I hope this helps.

Thomas

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events