Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict Jira workflow status only for specific project and for specific user group

Chaya March 11, 2025

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?

1 answer

1 accepted

2 votes
Answer accepted
Tuncay Senturk
Community Champion
March 11, 2025

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)

 

Suggest an answer

Log in or Sign up to answer