Forums

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

Restrict Priorities by Group in JIRA 6.3

ananias gutierrez carpio October 13, 2017

 

Hello, I have a problem restricting the priority in JIRA 6.3,

the items I have an option None and I do not want you to appear for a project.

do the same test in JIRA 7 and I had no problem,

my code is as follows:

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.sal.api.user.UserManager
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-administrators')) {

def allowedPriorities = constantsManager.getPriorityObjects().findAll {
it.id.toInteger() ==3
}.collectEntries { [(it.id): it.name] }
getFieldById(PRIORITY).setFieldOptions(allowedPriorities)
}

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events