def issueKey = 'QAMEW-14'
def logTest=get('/rest/api/2/issue/' + issueKey)
.header('Content-Type', 'application/json')
.asObject(Map)
logger.info("test ======>>>>> "+logTest.body.fields.status.name)
def result = put('/rest/api/2/issue/' + issueKey)
.header('Content-Type', 'application/json')
.body([
fields:[
status:[ name:"Backlog"
]
]
]
)
.asString()
if (result.status == 204) {
return 'Success'
} else {
return "${result.status}: ${result.body}"
}
I keep getting this error...why:
PUT request to /rest/api/2/issue/QAMEW-14 returned an error code: status: 400 - Bad Request
body: {"errorMessages":[],"errors":{"status":"Field 'status' cannot be set. It is not on the appropriate screen, or unknown."}}
Serializing object into 'interface java.util.Map'
Please use the ScriptRunner user to complete this task not the Initiating User.
See https://docs.atlassian.com/jira/REST/cloud/#api/2/issue-editIssue for more information.
If you are using the ScriptRunner user then check the Field Configuration