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)
}
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.