ResolveParentAfterSubTasks not working as expected

We are trying to use the Script Runner post-function 'Transition parent when all subtasks are resolved'.

Issue we are working with has six subtasks. When all subtasks are resolved the issue does not transition. Here is what we are seeing in the logs:

2014-05-08 09:56:53,366 http-bio-8080-exec-11 DEBUG dre 596x240617x1 1jmaxot X.X.X.X,0:0:0:0:0:0:0:1 /secure/WorkflowUIDispatcher.jspa [canned.workflow.postfunctions.ResolveParentAfterSubtasks] actionName: 121 Resolved
2014-05-08 09:56:53,366 http-bio-8080-exec-11 DEBUG dre 596x240617x1 1jmaxot X.X.X.X,0:0:0:0:0:0:0:1 /secure/WorkflowUIDispatcher.jspa [canned.workflow.postfunctions.ResolveParentAfterSubtasks] subtask: IR-431
2014-05-08 09:56:53,366 http-bio-8080-exec-11 DEBUG dre 596x240617x1 1jmaxot X.X.X.X,0:0:0:0:0:0:0:1 /secure/WorkflowUIDispatcher.jspa [canned.workflow.postfunctions.ResolveParentAfterSubtasks] subtask.isSubTask(): true
2014-05-08 09:56:53,369 http-bio-8080-exec-11 DEBUG dre 596x240617x1 1jmaxot X.X.X.X,0:0:0:0:0:0:0:1 /secure/WorkflowUIDispatcher.jspa [canned.workflow.postfunctions.ResolveParentAfterSubtasks] Resolve parent
2014-05-08 09:56:53,370 http-bio-8080-exec-11 WARN dre 596x240617x1 1jmaxot X.X.X.X,0:0:0:0:0:0:0:1 /secure/WorkflowUIDispatcher.jspa [canned.workflow.postfunctions.ResolveParentAfterSubtasks] Action name: 121 Resolved not found for this step.

The parameters we supplied for thepost function are

Parent Action: Resolved (121)
Resolution: Completed

The transition 'Resolved (121)' is used in numerous other workflows. This snippet from the post-function groovy is where things go awry:

if (allResolved) {
    log.debug ("Resolve parent")
    Integer actionId = actionName?.replaceAll(/ .*/, "") as Integer
    if (WorkflowUtils.hasAction(parent, actionId)) {
        WorkflowUtils.resolveIssue(parent, actionId, user, resolutionId, [:])
    }
    else {
        log.warn("Action name: $actionName not found for this step.")
    }
}

What are we doing wrong?

Thanks.

1 answer

This widget could not be displayed.

Are you 100% sure that the action id is 121, and when you mouse over it on the parent issue, the url shown in the status bar has action=121 ?

That code has been around a long time, I doubt if it's not working. The way it's done is not ideal but it's for backwards compatibility.

Where should I be doing the hover? In the workflow editor?

The only thing mentioned there are Step Ids and Transition Ids. In the workflow the Step Id for Resolved is 52 and the Transition ID for Resolved is 121. In the drop down when setting up the post function parent action only 'Resolved (121)' appears which is why that was selected.

OK. I think I found the spot. In the parent issue, if I clcik on 'Workflow' and then hover over 'Resolved' the URL at the bottom of the page includes 'action=121'. Also, the annotation box that pops up says 'Resolved - Managed by JIRA Agile.' Not sure if that is significant or not.

History is only showing myself and the other developer as having done any transitions.

Can you check the history? Maybe JIRA Agile is doing an action on the issue as well, so at the point the script runs, the action is not valid.

Just another point of information. It does not matter what transition/resolution we choose. The issue still does not transition to the chosen state.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

513 views 3 18
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