I have a issue that requires 4 approvals, so I created 4 sub-tasks with the Script Runner and set the custom field 'Role' to the group that can approve.
But I need to ensure that the user that approves one sub-task do not approve the others.
How can I do this?
I'm trying to use this script in workflow condition of my subtask.
def parentIssue = issue.getParentObject() def subTasksIssue = parentIssue.getSubTaskObjects() for (int i = 0; i < subTasksIssue.size(); i++) { if (subTasksIssue[i].getAssignee() == currentUser) { return false; } } return true;
I put this code at the Builtin Script it works, but when I put in my workflow condition it always return true and I don't know why.
I would keep it simpler than creating 4 sub-tasks and keep the one issue.
Use one "Approval" state and 4 loopback transitions for the approvals. e.g. Approval 1, Approval 2, Approval 3 (or name them by the function of the approver) where each transition starts in "Approval" & ends back in "Approval"
You could also have 4 User picker custom fields to record who did each approval.
Only when all 4 approvals are in place do you open up the exit transition to finalise the approval.
You could use the Misc workflow extenstions plugin to enact a "Separation of Duties" so that users could only do one of the transitions.....
https://marketplace.atlassian.com/plugins/com.innovalog.jmwe.jira-misc-workflow-extensions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Add condition in the workflow which will allow only users in group specified by "Group Custom Field" to execute the Approve transition.
User Is In Group Custom Field- Condition to allow only users in a custom field-specified group to execute a transition.
Assuming your 'Role' custom field is of type "Group custom field".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My problem is that the group have 4 users and I created 4 sub-task (this number is fix), so I need that if the first user approve the first sub-task then he can't approve the others three.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Then you can add a User Picker custom field to the parent issue which is set by post-function when the first sub-task is approved and then a script condition which checks this field and allows only this user to execute the transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.