The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.ModifiedValue import com.atlassian.jira.issue.util.DefaultIssueChangeHolder import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.customfields.manager.OptionsManager import com.atlassian.jira.issue.customfields.option.Option def issue = event.issue as Issue def customFieldManager = ComponentAccessor.getCustomFieldManager() def escalatedField = customFieldManager.getCustomFieldObjects(event.issue).find {it.name == "Escalated"} def urgencyField = customFieldManager.getCustomFieldObjects(event.issue).find {it.name == "Urgency"} def changeHolder = new DefaultIssueChangeHolder() def urgencyValue = issue.getCustomFieldValue(urgencyField) if (urgencyValue in ["Medium"]) { OptionsManager optionsManager = ComponentAccessor.getOptionsManager() def cfValue = optionsManager.getOptions(escalatedField.getRelevantConfig(issue)).getOptionForValue("Yes",null) escalatedField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(escalatedField), cfValue ),changeHolder) }
Code is above. The checkbox field (escalatedField) is set when I do not add the if statement: if (urgencyValue in ["Medium"])
Any assistance would be appreciated!
It works when I do
String urgencyValue = issue.getCustomFieldValue(urgencyField)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.