It seems the expression ‘preewalue = preewalue + 1’ is not working in scriptrunner for Jira Cloud, the error pls refer to the picture, thanks.
def eventissue = Issues.getByKey(issue.key as String)
Long reopencountfieldId = 10883
if(eventissue){
def preewalue = eventissue.getCustomFieldValue(reopencountfieldId)
preewalue = preewalue + 1
eventissue.update {
setCustomFieldValue(reopencountfieldId, preewalue)
}
}