Assignee sub-task

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?

3 answers

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".

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.

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.

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.....

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.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,296 views 14 20
Join discussion

Atlassian User Groups

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!

Find my local user group

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

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot