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.ComponentAccessordef allowedProjectKey = "ABC" // this is the allowed project keydef allowedGroup = "some-group" // this is the allowed group namedef project = issue.projectObjectdef user = ComponentAccessor.jiraAuthenticationContext.loggedInUserreturn project.key == allowedProjectKey && ComponentAccessor.groupManager.isUserInGroup(user, allowedGroup)
It looks like you're new here. Sign in or register to get started.