Status A -> Transition to B -> Status B -> Transition to C -> Status C
You are talking about Transition to B. There is a postfunction "Assign to first member of role", lets say you configured role R.
If there is no member in role R, the issue "Transition to B" takes place without changing the assignee. The issue is in Status B.
I suspect "Move it to the next status" should mean Transition to C, correct?
In this case you have to add another script postfunction "Fast-track transition an issue" and add this condition to it.
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.security.roles.ProjectRoleManager def projectRoleManager = ComponentAccessor.getComponent(ProjectRoleManager) def projectRoleId = 10000 // ID of project role def role = projectRoleManager.getProjectRole(projectRoleId) def actors = projectRoleManager.getProjectRoleActors(role, issue.projectObject) !(actors.users)
Replace the projectRoleId with the ID of the corresponding role and choose the correct action for "Transition to C".
I think if you can get the source code of "Fast-track transition an issue" script and then modify it to check the roles. Do not start with "Assign to first member of role" script.
The reason is, "Fast-track transition an issue" script is the one that performs the required action. You need "Assign to first member of role" script only to understand how the validation (check the role members) should be done.
So start with "Fast-track transition an issue". Copy some code from "Assign to first member of role" into it. Good luck! :)
Mmh. This is not a question.
If you want to modify a builtin script, you can copy the source (through the provided source link in the script) and save it with a modified name to the path (under WEB-INF/classes) according to the package of the script (which should not be changed).
This new script can now be adapted by you to your needs.
Mmh, I took a look into the script. If there is no user in a role nothing happens, only a warning message is logged to the log file. So the transition should happen.
Is that what you want? Or is "the next status" another transition after this transition?
Still not able to achieve it, its still going to transition B eventhough the condition is not met: I have added both post functions as given below:
Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...
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