Resolution based on Security Level

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?

 

2 answers

1 accepted

This widget could not be displayed.

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

This widget could not be displayed.

Wow...thank-you so much.  This is exactly what I was looking for!

Glad I was able to help.

Kristian

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted 11 hours ago in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

32 views 1 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you