I have a custom field that has multiple options.
I am trying to update Option 1 via a script using ScriptRunner
put("/rest/api/2/issue/${issueKey}")
.header("Content-Type", "application/json")
.body([
fields:[
"customfield_10066": [
"value": "Option1"
]
]
])
.asString()Problem: the above script returns an error:
2018-08-30 03:54:35.081 WARN - PUT request to /rest/api/2/issue/OP-35 returned an error code: status: 400 - Bad Request
body: {"errorMessages":[],"errors":{"Flag":"data was not an array"}}where "Flag" is the name of customfield_10066
Note: I have tried wrapping the value change as follows:
[{"value": "Option1"}]but this returns an equally fatal error:
Script1.groovy: 47: expecting '}', found ':' @ line 47, column 34.
[{"value": "Option1"}]
^