Adding options to custom Field Using API

Amit Saxena March 22, 2022

Hello Team,

I am looking for APIs which can add options to Single Select or  multi-selected type custom fields. I read most of articles but nothing is confirmed if we can add it or not.

 

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

But it doesn't seems to be working. Please let me know if there is something I missed.

 

Regards

1 answer

0 votes
Simone Kaden January 5, 2023

Hey, I don't know if you already found something. But i recently made it work.

 

Here is what I did:

  • Create an automation with the trigger you desire.
  • Select as action the "Send web request"
  • select POST
  • enter the URL:  https:\\{yourInstance}/rest/api/3/field/{fieldId}/context/{contextId}/option

important is to include following headers:

  • Content-Type --> application/json
  • Authorization --> API Token of a User with admin permissions who is allowed to create options of a custom field
  • Referer --> same URL you insert into the "Web request URL" field

 

More infos here: 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

 

Hope this helps

Simone

Suggest an answer

Log in or Sign up to answer