import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def issue = underlyingIssue
def tgtField = customFieldManager.getCustomFieldObjects(issue).find {it.name == "PSIT Severity"}
// Get a pointer to both my fields
def demoSelect = getFieldByName("PSIT Severity")
def demoMultiTxt = getFieldByName("Severity Update Flag")
// Get the Value of the Select List Field
def selectedVal = demoSelect?.getValue()
def previousVal = tgtField?.getValue(issue)
if (selectedVal != null){
if (selectedVal?.toString()?.equalsIgnoreCase(previousVal?.toString())) {
log.debug("Values are the same I will set the Val to False")
String val ="False"
demoMultiTxt?.setFormValue(val)
} else {
log.debug("Values are different I will set the Val to True")
String val ="True"
demoMultiTxt?.setFormValue(val)
}
}