The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

2 votes
Answer accepted
Tuncay Senturk _Snapbytes_
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)