Transition parent to close when sub-tasks are closed (is not working the way it should)

Tarun Sapra Community Champion Apr 10, 2013

Hi,

As described in this link

https://answers.atlassian.com/questions/75677/automatic-transition-on-parent-issue-when-all-sub-tasks-are-closed

I did everything as mentioned in the link and it only works when the parent is at the exact same status for which the transition is defined in the workflow and corresponding transition ID is specified in the post funtion of sub-task.

Example - Parent is in open status - and the sub-tasks are now closed, according to sub-task post-function the transition ID is triggered that transition ID is part of parent workflow from IN-progress to Close but the Parent is currently in Open state instead of in-progress so the parent doesn't close as it's in Open state instead of In-progress, but shouldn't the parent just close irrespective of it's current state even if it's in Open state? if the parent was in In-progress state it would have worked fine.

Please suggest how to achieve the functionality where-in I can trigger a transition Id from the sub-tasks which pushes the parent to close state irrespective of it's current state.

Thanks,

I am using JIRA 4.4.4

13 answers

1 accepted

Accepted Answer
1 vote
Tarun Sapra Community Champion Apr 14, 2013

Answer from oilspace is partially correct -

but to complete it is to make the global transition hidden, thus use the hidden feature from workflow misc. plugin as well...

and it works smoothly :)

Complete WF condition -

Hide transition from the user (the transition can be triggered only programmatically or from a workflow function).

— AND
All sub-tasks must have one of the following statuses to allow parent issue transitions: Closed.

you create "Close"(in parent workflow) as global transition from any state to close status and trigger it

Hi Tarun,

You must add a post function for each workflow transition you wish to put the parent through; so if your parent workflow is "Open > In Progress > Closed", and you want the close transition of the sub-task workflow to put the parent from Open to Closed, you need one post function that transitions the parent to In Progress, and one that transitions the parent to Closed. :)

Tarun Sapra Community Champion Apr 11, 2013

grrrrr... let me give it a try with a hidden global transition instead.

What is this "hidden global transition" you speak of? it sounds intruiging!

I made a global transition and in the conditions I made it hidden

Hide transition from the user (the transition can be triggered only programmatically or from a workflow function).
Add grouped condition | Delete
All sub-tasks must have one of the following statuses to allow parent issue transitions: Closed.
Add grouped condition | Edit | Delete
Tarun Sapra Community Champion Apr 11, 2013
Below is the workflowcondition with AND condition for the global transition.
Hide transition from the user (the transition can be triggered only programmatically or from a workflow function).

— AND
All sub-tasks must have one of the following statuses to allow parent issue transitions: Closed.

Create a global transition and make it hidden in the workflow.

Hide transition from the user (the transition can be triggered only programmatically or from a workflow function).
— AND
All sub-tasks must have one of the following statuses to allow parent issue transitions: Closed.

Interesting, thanks for the info. I don't see the Hide Transition option in my available conditions and I'm wondering if it's something added since our version. We're on 4.3.4 still.

(sorry for the thread hijack but this is something I could really use)

Tarun Sapra Community Champion Apr 11, 2013

I am usin' 4.4.4 and hide transtion is part of workflow misc. plugin, it's a must have plugin for complex workflows.

https://marketplace.atlassian.com/plugins/com.innovalog.jmwe.jira-misc-workflow-extensions

@Tarun Sapra - I have a workflow with atleast 10 states and finish being the last transition in the workflow. All the transitions have validators in it. This workflow further has a subtask which has a different workflow with 4states and done is the last transition.

I have added a validator "Transition parent issue - "Finish" in the subtask workflow and parent workflow has the "subtask blocking condition - "Done". Incase like as you said no matter in whichever the transition of the parent issue is , as soon as all the subtasks for the parent workflow are done i would like to move the parent workflow to the "Finish" transition. Where should i be adding the "Hide Transition option" in parent workflow.?

Also if there are validators for all the transitions will this "Hide Transition" feature work??

Require your feedback urgently as i am stuck up in a critical issue.

Tarun Sapra Community Champion Oct 23, 2013

Hi Jayashree, Add a global transition in parent workflow from eact state to final state and make it hidden in the parent workflow. and subtask should trigger this transition in their post function.

Thank you Tarun. But just one more question, by making the states which are in between the start and end state as hidden, will the validators fire for those middle states? Because at those intermediate states we require some user i/p as a result of which we fire the validators at each step, so we would want to still retain this.

What does a global transition mean?

I have added a "Global Transition" in my parent workflow (i cant see though).Also there is a condition "subtask blocking condition " which i have added to the parent wf i.e All sub-tasks must have one of the following statuses to allow parent issue transitions:Done.

What post function in SBI should we write to trigger this?

Also the global transition is visible througout the workflow steps. if i use "Hide transition option" then it hides the implementation which i have done and not the global transition.How to resolve this?

Thanks it worked

Thanks it worked

One more question. In case i have to choose a state for global transition to happen from some specific state (dont want to have the global transition from the initial state) how can we configure this? Because in starting few states of the parent workflow we have some crucial states wherein we need to key in some values. So we dont want the global transition to work here.Can we achieve this? In short i would want to choose original and destination step, can that be done?

Tarun Sapra Community Champion Oct 24, 2013

Hi Jayashree,

You can add the condition in the global transtion in which you can specify the value field as the status with the value as the originating step.

https://jsutil.atlassian.net/wiki/display/JSUTIL/JIRA+Suite+Utilities+Workflow+Conditions

Hi Tarun,

I did the same steps as you mentioned above, but it isnt working. These are the steps which i followed:

1)Added a global transition. Gave the destination step as per the requirement

2) Added a value field as Status and this status is equated to the id value of origin state.

Now when i make all the subtasks under the parent task as done, and if the parent task is in the state as mentioned in the value state, then i expected the parent task would move to the destination step as configured in the global transition.
But it isnt trigerring.

Tarun Sapra Community Champion Oct 28, 2013

Value field for Status as compared as String, so if you put name in the condition instead of Id, that might work.

@Tarun Sapra

Hi Tarun,

I'm attempting to configure this and am not successful. This is my workflow (also attached):

On parent workflow, status "SA Review" transitions via "BRD Reviewed" to status "Pending Approval". Five subtasks are automatically fired upon "BRD Reviewed". When all 5  subtasks are to status "Approved" within subtask workflow, I would like for status "Pending Approval" to automatically transition via hidden transition "Approvals Gained" to status "Functional Definition" within the parent workflow.

Currently configured:

"Approvals Gained" transition on parent workflow-

Condition "Hide transition from the user (the transition can be triggered only programmatically or from a workflow function)."

Condition "All sub-tasks must have one of the following statuses to allow parent issue transitions: Approved"       

"Approved" transition on subtask workflow-

post function "Transition 941 (note: which is "approvals gained" transition id in parent workflow) will be triggered on the issue's parent issue"

condition "All sub-tasks must have one of the following statuses to allow parent issue transitions: Approved" (note: I tested with and without this condition without success)

Advice?                                            

                                                                         

 

 

Nevermind! Got it figured out. I had to move the post function to the bottom.

Well i did that too initially, it didnt work. Am i missing something?

Well i did that too initially, it didnt work. Am i missing something?

Tarun Sapra Community Champion Oct 28, 2013

Please post your WF condition.

Global Transition in Parent Workflow:

a) The field Status will have to be equal to value '20'. Compared as Number

This below condition is at the final state of Parent Workflow called "Finish"

b) All sub-tasks must have one of the following statuses to allow parent issue transitions: Done

Subtask doesnt have any condition

Tarun Sapra Community Champion Oct 28, 2013

I think your missing something very minor,

here's how i did it -

My global transition -

Hide transition from the user (the transition can be triggered only programmatically or from a workflow function).

— AND

All sub-tasks must have one of the following statuses to allow parent issue transitions: Closed.

Now from subtasks, I am triggering this transition via a post function, transition parent issue.

and on each visible close transition(common to both parent and subtask), I have the condition -

All sub-tasks must have one of the following statuses to allow parent issue transitions: Closed.

Oh i missed that triggering the transition from subtask. Thank you. WIll try it and let you know

Can you send screenshot for the post function and condition for each  workflow. Thanks

It worked . Thank you so much.

Tarun Sapra Community Champion Oct 28, 2013

would be nice , if you upvote my anwers :)

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

25,098 views 2 7
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