Transition Parent based on all subtasks being in a certain workflow state

Hi All! Newbie here!

I know someone can help :)

I have read this post....

I'm having the same issue. My workflows for parent and subtask are different. What i'm wanting is to transition from "Validated" to "Records Requested" in the parent workflow based on its subtasks reaching a workflow state of "Passed". As mentioned the parent and the subtask have different workflows.

This was my starting code from the previous post but i've done nothing to it. Please could someone thow a hand and tell me what changes i need to make? I did read i needed....

"a script on the sub-task workflow. You can either hard-code the action ID or look it up by name from the WorkflowManager)"



import com.opensymphony.workflow.WorkflowContext;

import com.atlassian.jira.config.SubTaskManager;

import com.atlassian.jira.workflow.WorkflowTransitionUtil;

import com.atlassian.jira.workflow.WorkflowTransitionUtilImpl;

import com.atlassian.jira.util.JiraUtils;

import com.atlassian.jira.issue.MutableIssue;

import com.atlassian.jira.component.ComponentAccessor


String currentUser = ((WorkflowContext) transientVars.get("context")).getCaller()

WorkflowTransitionUtil workflowTransitionUtil = (WorkflowTransitionUtil) JiraUtils.loadComponent(WorkflowTransitionUtilImpl.class)

MutableIssue parent = issue.getParentObject() as MutableIssue


String originalParentStatus  = parent.status?.name

def isDevBacklogStatus = originalParentStatus in ['Next Up Dev', 'Backlog Dev', 'Selected for Development']


if (isDevBacklogStatus) {




    if (workflowTransitionUtil.validate()) {








Thanks in advance and hoping for a favourable reply :)


1 answer

Hi Darren,

I think you have a couple of options here. The first option is to use a workflow transition condition. I found a post where someone else has done this exact same thing here (

You might not be able to get that to work with your workflow setup (i.e. the parent task having a different workflow to the subtask, although I think it will be fine). If you struggle with that you could modify the approach slightly by using a ScriptRunner script condition instead of a sub-task blocking condition.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 13, 2019 in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


251 views 0 6
Read article

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