Hello,
I am looking for a option whenever the priorities field changed manually from Incident, Project "SMXBID"the Comment to be added automatically ""Priorities changed from Minor to Major" in Jira
I attached screendump , kindly see if i am using correct EVENT and also see below script where i get error message and no comment is added while executing.
Please assist my script , remeber it should add comment Old value to new value (""Priorities changed from Minor(old value) to Major"(new value) )

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.priority.Priority
issue.projectObject.key == 'SMXBID'
issue.issueType.name == 'Incident'
// Check if priority changeddef customFieldManager = ComponentAccessor.getCustomFieldManager()
def change = event?.getChangeLog()?.getRelated("ChildChangeItem").find
{it.field == "priority"}
if (change) {
log.warn "Priority Changed"
}else{
log.warn "Priority remain same"
}