I use this article to restrict resolutions by IssueType using Behaviour, but it doesn't work.
https://scriptrunner.adaptavist.com/latest/jira/recipes/behaviours/restricting-priority-and-resolution.html
I change my parametres as the code bellow and when I do a test, still appear all resolutions,.
my script:
import com.atlassian.jira.component.ComponentAccessor
import static com.atlassian.jira.issue.IssueFieldConstants.Resolution
if (getActionName() == "Close Issue") {
def constantsManager = ComponentAccessor.constantsManager
def allowedResolutions = constantsManager.resolutions.findAll {
it.name in ["Duplicated"]
}
getFieldById("Resolution").setFieldOptions(allowedResolutions)
}