Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

ResolveParentAfterSubTasks not working as expected

Daniel Ehrlich May 7, 2014

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

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 8, 2014

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.

Daniel Ehrlich May 8, 2014

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.

Daniel Ehrlich May 8, 2014

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.

Daniel Ehrlich May 8, 2014

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

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 8, 2014

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.

Daniel Ehrlich May 11, 2014

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
TAGS
AUG Leaders

Atlassian Community Events