Forums

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

I would like to add customfield's drop down menu (single selection) value by API.

Charlie Lee
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!
August 10, 2023

I would like to add customfield's drop down values information using REST API or Scriptrunner.

Script runner has a "Bulk import custom field values" which is exactly what we want, but we would like a to do that using a external script instead of a web form so that we can automate them.

Has anyone actually accomplished this send me REST API URL used with data they sent? We are currently using rest server 9.8.0 V2 not V3.

1 answer

0 votes
carlosughini
Community Champion
August 10, 2023

Hello Charlie,

Welcome to the community!

You can definitely creates options and, where the custom select field is of the type Select List (cascading), cascading options for a custom select field. It is important to note that the options are added to a context of the field.

You can use a REST API call to create the options. Specifically this endpoint:

POST /rest/api/3/field/{fieldId}/context/{contextId}/option

More info on the above endpoint can be found below:

Please give it a try and let me know how it goes.

Kind regards,

Carlos

Charlie Lee
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!
August 10, 2023

I did try that as per document but that doesn’t work. Field API doesn’t find custom fields. Also I never found a way to fetch contextID afterwards. I would like to see someone trying that to see if it works on their machine 

Suggest an answer

Log in or Sign up to answer