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

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!

Glad I was able to help.

Kristian

Suggest an answer

Log in or Sign up to answer
Community showcase
Asked Thursday in Jira Ops

I'm John Allspaw, Ask Me Anything about incident analysis and postmortems

I'm John Allspaw, co-founder of   Adaptive Capacity Labs, where we help teams use their incidents to learn and improve. We bring research-driven methods and approaches to drive effective inciden...

474 views 2 5
View question

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