'Get suggestions edit' REST API don't work

Hi, there.

I want to get option list by using the following API on JIRA Cloud.

``/rest/api/2/field/{fieldKey}/option/suggestions/edit

I called this API with several patterns on my browser as JIRA administrator,

https://xxxxxx.atlassian.net/rest/api/2/field/customfield_10500/option/suggestions/edit
https://xxxxxx.atlassian.net/rest/api/2/field/10500/option/suggestions/edit
https://xxxxxx.atlassian.net/rest/api/2/field/SingleSelect/option/suggestions/edit

but all these tries returned 404 error.

{
“errorMessages”: [
“The field with the given key does not exist or does not support options”
],
“errors”: {}
}

What should I use as {fieldKey}?


(editmeta)

“customfield_10500”:{
“required”:false,
“schema”:{
“type”:“option”,
“custom”:“com.atlassian.jira.plugin.system.customfieldtypes:select”,
“customId”:10500
},
“name”:“SingleSelect”,
“key”:“customfield_10500”,
“operations”:[
“set”
],
“allowedValues”:[
{
“self”:“https://xxxxx.atlassian.net/rest/api/2/customFieldOption/10505”,
“value”:“apple”,
“id”:“10505”
},
{
“self”:“https://xxxxx.atlassian.net/rest/api/2/customFieldOption/10506”,
“value”:“orange”,
“id”:“10506”
}
]
},

I think your first example is the correct one:

https://xxxxxx.atlassian.net/rest/api/2/field/customfield_10500/option/suggestions/edit

Are you submitting that request as the add-on user, or are you submitting it on behalf of an actual end-user? I’m wondering if somehow the field isn’t visible to the calling user.

Thanks, David.

I noticed that I tried to apply the api to general ‘Select List’ field created by hand on ‘Custom fields’ Management Screen.

The rest api document says,

Select list issue fields can be defined by a Connect add-on. The add-on that provided the field can add,
remove and update the options using the methods defined in this resource.

1 Like

@abe.kenichi - so what did you end up doing here? I am in a similar situation and I successfully created a custom select field through the API but I am still not able to get a list of options by any of the fieldKeys I’ve tried.

Thanks!

Hi igor.

I had tried to use this api(/rest/api/2/field/{fieldKey}/option) for standard custom field.

But this api was for ‘select list issue field’ defined in atlassian-connet.json.
(Using the issue field module)

If you want to get options for any custom field, I think you can use ‘/rest/api/2/customFieldOption/{id}’.

1 Like