I have over 30 resolutions and one of the groups is asking to only show a subset of those when they click resolution. I was able to get something similar to work for the priority but can't seem to figure out how to do the resolution the few links I have found just say use a behavior (this I know as it is what I used for priority) however I am not seeing any examples for it so I am at a loss.
Community moderators have prevented the ability to post new answers.
Hi Michelle,
I have attached a script which I have used to only show a subset of resolutions to all users in a group as a Behaviours script below.
The script uses the jira-software-users group as an example but this can be replaced with the group inside your instance. This has been tested on my local JIRA 7.2.2 instance running ScriptRunner 4.3.9.
Code:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.sal.api.user.UserManager import static com.atlassian.jira.issue.IssueFieldConstants.RESOLUTION def constantsManager = ComponentAccessor.getConstantsManager() def userUtil = ComponentAccessor.getUserUtil() log.debug ComponentAccessor.getComponent(UserManager) def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser() if (userUtil.getGroupNamesForUser(currentUser.name).contains("jira-software-users")) { def allowedResolutions = constantsManager.getResolutionObjects().findAll { it.name in ["Won't Do", "Duplicate", "Cannot Reproduce"] }.collectEntries { [(it.id): it.name] } getFieldById(RESOLUTION).setFieldOptions(allowedResolutions) }
Config:
Screen Shot 2016-10-07 at 15.06.59.png
I hope this helps.
Thanks
Kristian
Worked perfectly thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad I was able to help.
Thanks
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Theres an example here of how to do that using behaviours.
You need to add the Resolution field in your behaviour and then click add serverside script to attach that script.
Essentially what you want is:
import com.atlassian.jira.component.ComponentAccessor import static com.atlassian.jira.issue.IssueFieldConstants.RESOLUTION def constantsManager = ComponentAccessor.getConstantsManager() def allowedResolutions = constantsManager.getResolutionObjects().findAll { it.name in ["Won't Fix", "Incomplete", "Cannot Reproduce"] } getFieldById(RESOLUTION).setFieldOptions(allowedResolutions)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can do this out of the box with JIRA by using Workflow Transition Properties.
Adding the properties jira.field.resolution.exclude
or jira.field.resolution.include
to the Transition where the Resolution field is being presented allow you to exclude specific or to include specific resolutions, respectively.
https://confluence.atlassian.com/adminjiraserver071/workflow-properties-802592825.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.