Using Script Runner Fast-track transition an issue, how can i have it so it changes the status based on the Asignee's role.
Rob is in QA, Mike is a PM
Issue is assigned to Rob when created, so the issue is set to status QA
You could this script to test the assignee role.
import com.atlassian.jira.security.roles.ProjectRoleActors import com.atlassian.jira.security.roles.ProjectRoleManager String role = 'QA' ProjectRoleManager projectRoleManager = componentManager.getComponentInstanceOfType(ProjectRoleManager.class) ProjectRoleActors projectRoleActors = projectRoleManager.getProjectRoleActors(projectRoleManager.getProjectRole(role), issue.getProjectObject()) projectRoleActors.getUsers().contains(issue.assignee)
You seem to have two different conditions here. You can use both, combined with an AND or and OR, but it's worth being clear.
Henning's use of isUserMemberOf does answer your original question, - it will let people in the role of Administrator to run your "fast track" transition. If I were to log in as an ordinary project user, then I simply would not see the "fast track" and I couldn't run it.
The assignee is a separate condition. You can add that in a second condition on the transition to make the logic say "Fast track can only be done by admins, OR the current assignee". Or, you could make it say "the user must be the assignee AND they must be an admin".
In all cases, Jira looks at the person logged in to match them against those conditions (it's nonsense to do it any other way)
I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs