Hello the community,
I try to find a solution on my listener script.
I have two field urgency and impact. I would like to change the priority if one of these fields is updated.
I write the following script but I don't know how to do the update of priority fields.
Could you help me to find the solution?
The script:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueInputParametersImpl
import com.atlassian.jira.issue.customfields.option.Option
import org.apache.log4j.Level
log.setLevel(Level.DEBUG)
def issue = event.issue as Issue;
def urgency = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("[IMP] Urgency")
def impact = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("[IMP] Impact")
def valueUrgency = issue.getCustomFieldValue(urgency)
def valueImpact = issue.getCustomFieldValue(impact)
log.debug "impact value " + valueImpact;
log.debug "urgency value " + valueUrgency;
if (valueImpact == "High" && valueUrgency == "Medium"){
} else if (valueImpact == "Medium" && valueUrgency == "High"){
} else if (valueImpact == "Medium" && valueUrgency == "Medium"){
} else if (valueImpact == "High" && valueUrgency == "High"){
} else {
}
Thank you a lot for your help.
Regards,
Mickael O.