I want to set an id for the fixVersion by a script.
It is able to set by REST API using Python' s requests method as following,
#------
url = "https://xxxxxxx.atlassian.net/rest/api/3/issue/TTES3-6"
auth = HTTPBasicAuth("xxxx","xxxxxx")
headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}
payload = json.dumps( {
"fields": {
"fixVersions": [{"id": "10091"} ],
}})
response = requests.request(
"PUT",
url,
data=payload,
headers=headers,
auth=auth
)
print (response.status_code)
But it is unable to set using ScriptRunner's Script Console,
#------
def result = put("/rest/api/3/issue/TTES3-6")
.header('Content-Type', 'application/json')
.body([
fields:[ fixVersions:[{id: '10091'}]
]
])
.asObject(Map)
return result.status
#-----
Return code is 204, but the fixVersion field becomes blank.
(Another field like summary or custom field seems to be able to set value using same method....)
What's wrong?