How to Update the Custom field options with Jira Rest API?

Amiya Kumar Sahoo January 13, 2023

Hi Team,

Is there any way to update the Custom field options with Jira Rest API?(especially a dropdown, single select list, Radio button type Custom-field)


I followed Jira's Rest API docs and found this particular REST API which is currently experimental:
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-options/#api-rest-api-3-field-fieldid-context-contextid-option-put



Trying this API i Postman as per the documentation I am getting these kind of errors:

For Create custom field option:

{
"errorMessages": [
"The custom field doesn't support cascading options."
],
"errors": {}
}

For Update custom field option:

{
"errorMessages": [
"Invalid request payload. Refer to the REST API documentation and try again."
]
}


Does anyone have any idea when these experimental features will be working properly?

Kind help me in dealing with this.


Thanks in Adv,
Amiya





1 answer

1 vote
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 15, 2023

Hi @Amiya Kumar Sahoo --

It looks like Jira thinks you are trying to add/edit cascading options to a single select field. 

I think you need to make sure you are not including optionId because when I click on the CustomFieldOptionCreate array definition it shows that optionId is "For cascading options, the ID of the custom field object containing the cascading option."

Screen Shot 2023-01-15 at 6.09.58 PM.png

So I think you don't need to include any kind of id at all if you are doing a Create, because it should automatically generate it. If you are doing an update, well, you'll need the id then because you're editing an existing option value.

But probably the key thing here is that you don't need optionId if your field is not a cascading select.

Could you share the JSON payload you are sending to the API endpoint? 

Also, have you tried doing a GET of all the current options for your field, which would give you a guideline for how to format your JSON payload?

Recently @shardern had success with this after figuring out Context ID, so if you have further issues can share your payload, maybe he can help troubleshoot.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events