We use a behaviours script to restrict the issue type selection for a specific project role.
For the restriction to one issue type the following script works perfectly:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.roles.ProjectRoleManager
import static com.atlassian.jira.issue.IssueFieldConstants.ISSUE_TYPE
def constantsManager = ComponentAccessor.getConstantsManager()
def queryIssueType = constantsManager.getAllIssueTypeObjects().find { it.name == "Feedback"}
def IssueType = getFieldById(ISSUE_TYPE)
IssueType.setFormValue(queryIssueType.id)
The question is: How to change the script for a restriction to TWO issue types???
Hello,
What version of ScriptRunner are you currently using?
There is a bug that may prevent you from being able to do this effecting newer versions.
Jenna
Hi Jenna,
we are using the version 5.2.2 of ScriptRunner.
Will there be a solution for the bug in the near future?
Thanks,
Judith
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe that bug will effect you then.
I'm afraid we don't have a set timeline for issues, so I cannot give you a good estimate.
Jenna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Judith Becker Try this approach.
import com.atlassian.jira.component.ComponentAccessor
def groupManager = ComponentAccessor.getGroupManager()
issue.projectObject.key == 'AR' &&
(!groupManager.isUserInGroup(issue.reporter?.name, 'abc') &&
issue.issueType.name in 'Bug' ||'Story')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.