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

1 vote
Answer 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
Posted Oct 09, 2018 in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

388 views 6 0
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