Hi,
I want to create an option for a single choice custom field via RES API.
In the documentation it seems it's possible with this:
POST /rest/api/3/field/{fieldId}/context/{contextId}/option
But the response i get is:
Invalid request payload. Refer to the REST API documentation and try again.
Here is the code i'm trying:
Thanks!
hello @Patricia González ,
The payload you are providing seems wrong.
You should provide something like:
"options": [ { "disabled": false, "value": "Scranton" }]
Details of the options to create for a custom field.
Array<CustomFieldOptionCreate>
Details of options to create.
CustomFieldOptionCreate → { "value": "<string>", "optionId": "<string>", "disabled": true }
You can see the example here
and the return code if everything went fine will be http 200, not 204 ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried what you suggested, but it didn`t work either.
(I'm using scriptrunner btw).
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you should try something like
result = post(url)
.header("Content-Type", application/json)
.body(
[options:[[disabled:false,value:"scranton"]]])
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.