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.