So I'm trying to set checkbox values using script runner specifically Script Listener.
This is the code I'm trying to execute
put("/rest/api/2/issue/${issueKey}")
.header('Content-Type', 'application/json')
.body([
fields: [
"customfield_10036": [
[["value": "ALL"], ["value": "BT7"], ["value": "MACS"], ["value": "SPINS"], ["value": "BT4"], ["value": "NGB30"], ["value": "NG7S"]]
]
]
]).asString()
However for some reason, I get this error
body: {"errorMessages":[],"errors":{"Instrument":"The Instrument value must be an object"}}
How the value not an object.
Thank you
Hi Fawaz,
I can confirm we have an example script that can be run on the script console that shows how to set a checkbox field here.
You will be able to use this script to help write the rest API call neeed to set the checkbox values via a script listener.
I hope this helps.
Regards,
Kristian
Just to add, the only issue with your call @Fawaz Joseph is you have 1 too many sets of brackets,
[["value": "ALL"] <- all your other options -> ["value": "NG7S"]]
Should become:
["value": "ALL"] <- all your other options -> ["value": "NG7S"]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Bobby Bailey
This fixed my problem
Thank you for the snippet @Kristian Walker _Adaptavist_
This will be very useful going foward
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fawaz,
You are welcome, and I am glad we managed to help you to achieve your requirement.
Regards,
Kristian
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.