Resolution based on Security Level

clem
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2016

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
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 26, 2016

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

0 votes
clem
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 27, 2016

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

Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 27, 2016

Glad I was able to help.

Kristian

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events