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)
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.