Hi,
I would like to remove a resolution value from the resolution dropdown if the issue is not a part of a security scheme.
Is that possible with behaviours?
@Jamie Echlin (Adaptavist) - Any ideas?
Hi Clem,
I have attached below a sample script which can be added as a behaviour on the resolution field in order to only display certain resolutions to users who are in a specific group.
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().getUser() if (userUtil.getGroupNamesForUser(currentUser.name).contains("jira-developers")) { def allowedResolutions = constantsManager.getResolutionObjects().findAll { it.name in ["Won't Fix", "Incomplete", "Cannot Reproduce"] }.collectEntries { [(it.id): it.name] } getFieldById(RESOLUTION).setFieldOptions(allowedResolutions) }
This should allow you to maintain a group of all users in a security scheme in order to only ensure they have access to certain resolutions.
I hope this helps
Kristian
Wow...thank-you so much. This is exactly what I was looking for!
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.
Kristian
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.