good afternoon I'm creating a script so when an IM is opened it sets the priority according to the summary, where if the summary contains p2 it creates the Im with Medium priority, but it's only creating with low priority, follow the script
import groovy.json.JsonSlurper;import groovy.json.StreamingJsonBuilder;import com.atlassian.jira.component.ComponentAccessor;import com.atlassian.jira.project.Projectimport java.net.URLimport java.net.URLEncoderimport com.atlassian.jira.issue.label.LabelManager
// veifica se não tem label de OpsgenieLabelManager labelManager = ComponentAccessor.getComponent(LabelManager)def labels = labelManager.getLabels(issue.id).collect{it.getLabel()}def issuetype = issue.getIssueType().name;
def projeto = issue.getProjectObject().getKey()if(projeto == "SDTEST"){ def priorityP2 def priorityP1 if(issue.getSummary().contains("P2")) priorityP2 = "Medium" if(issue.getSummary().contains("P1")) priorityP1 = "High"}