I'm trying to restrict the behavior via the Script Runner Plugin for the "Resolution" field options. My objective is to restrict the options below to just one project (Other projects would have all options). I have got this working r one transition (per the web page example) but I want to widen that to the entire workflow if possible so that whenever the resolution field is selected you only get the five options shown below. I believe I need to change the line "if (getActionName()" but I'm sure what that value should be:
import com.atlassian.jira.component.ComponentAccessor
import static com.atlassian.jira.issue.IssueFieldConstants.RESOLUTION
if (getActionName() == "The Transition Name") {
def constantsManager = ComponentAccessor.getConstantsManager()
def allowedResolutions = constantsManager.getResolutionObjects().findAll {
it.name in ["QA Verified", "Approved", "Manager Approved", "CRB Approved","Emergency Approved"]
}.collectEntries {
[(it.id): it.name]
}
getFieldById(RESOLUTION).setFieldOptions(allowedResolutions)
Thanks in advance for any assistance someone can provide.