Hi all -
I have a Behaviors script that was slightly modified from the user documentation. This essentially looks for an issue type and updates the list of resolution values the user can choose from (and hides the others) when they try to move it to Done status.
import com.atlassian.jira.component.ComponentAccessor
import static com.atlassian.jira.issue.IssueFieldConstants.RESOLUTION
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.Issue
if (issueContext.issueType.name == "Bug") {
def constantsManager = ComponentAccessor.constantsManager
def allowedResolutions = constantsManager.resolutions.findAll {
it.name in ["Code Change", "Cannot Reproduce", "Will Not Do]
}
getFieldById(RESOLUTION).setFieldOptions(allowedResolutions)
}
My only issue with this is that it currently sets a default value vs. forces the user to select from the list (Please select...). Is this possible? From my research it ignores values entered that don't exist in the system. Thank you
