Hello, I have a case where on a Script listener I want the action to check if the assignee is account id '999' if it is already 999 then take no action, if the assignee account id is not 999 then assignee the issue to 999. Here is an example of what I have so far, the first section is adding a label before it does this step so don't worry about that part. The only error I am getting is a red underline under the part in Bold.
def issueKey = issue.key
def addLabel = put("/rest/api/2/issue/${issue.key}")
.header('Content-Type', 'application/json')
.body([
update:[
labels:[
[
add: "label123"
]
]
]
])
.asObject(Map)
//Need to assign to 'joe bloggs' if it isn't already whos account id is 999.
// Get the current assignee
def currentAssigneeResponse = get("/rest/api/2/issue/${issue.key}")
.header('Content-Type', 'application/json')
.asObject(Map)
def currentAssignee = issue.assignee.accountId
// Check if the current assignee is already 'Joe Bloggs'
if (currentAssignee != "999") {
// Change the assignee to 'Joe Bloggs'
def changeAssignee = put("/rest/api/2/issue/${issue.key}")
.header('Content-Type', 'application/json')
.body([