I have a workflow which is common across multiple projects. I need to add restriction to a workflow status only for one project and that transition should be done only by specific user group. Is there a way to do it using scriptrunner?
Hi @Chaya
You can create a Script Condition with the following code, that should do the trick.
import com.atlassian.jira.component.ComponentAccessor
def allowedProjectKey = "ABC" // this is the allowed project key
def allowedGroup = "some-group" // this is the allowed group name
def project = issue.projectObject
def user = ComponentAccessor.jiraAuthenticationContext.loggedInUser
return project.key == allowedProjectKey && ComponentAccessor.groupManager.isUserInGroup(user, allowedGroup)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.