Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict visible Priorities between 2 groups

Steve Letch June 11, 2019

Hi

I'm currently looking at the Scriptrunner script to restrict priorities

import com.atlassian.jira.component.ComponentAccessor

import static com.atlassian.jira.issue.IssueFieldConstants.PRIORITY

def constantsManager = ComponentAccessor.getConstantsManager()

def userUtil = ComponentAccessor.getUserUtil()

def currentUser = ComponentAccessor.getJiraAuthenticationContext().getUser()
if (!userUtil.getGroupNamesForUser(currentUser.name).contains("jira-developers")) {

def allowedPriorities = constantsManager.getPriorityObjects().findAll {
it.id.toInteger() < 2
}.collectEntries {
[(it.id): it.name]
}

getFieldById(PRIORITY).setFieldOptions(allowedPriorities)
}

What I'd like to do in this script is instead of restricting by number, restrict by the priority names and also have another section where I can define a second list of priorities for a different group to see.

 

Essentially the client wants the infrastructure and 1st/2nd line engineers to see two different priority lists within the same project.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events