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

This widget could not be displayed.

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.

This widget could not be displayed.

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

This widget could not be displayed.

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 Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

195 views 3 0
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