It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

Tarun Sapra Community Leader 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

14 answers

1 accepted

1 vote
Answer accepted
Tarun Sapra Community Leader 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.
2 votes
Aspect Infra Team Apr 10, 2013

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

2 votes
Natalie Hobson Apr 10, 2013

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 Leader Apr 11, 2013

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

Kathy Tempesta Apr 11, 2013

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

Kathy Tempesta Apr 11, 2013

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

0 votes
Jayashree Shetty Oct 23, 2013

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

Jayashree Shetty Oct 24, 2013

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?

Jayashree Shetty Oct 24, 2013

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?

0 votes
Jayashree Shetty Oct 24, 2013

Thanks it worked

0 votes
Jayashree Shetty Oct 24, 2013

Thanks it worked

0 votes
Jayashree Shetty Oct 24, 2013

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

0 votes
Jayashree Shetty Oct 28, 2013

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

Kelsey Berry Mar 04, 2015

@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?                                            

                                                                         

 

 

Kelsey Berry Mar 13, 2015

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

0 votes
Jayashree Shetty Oct 28, 2013

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

0 votes
Jayashree Shetty Oct 28, 2013

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

Tarun Sapra Community Leader Oct 28, 2013

Please post your WF condition.

0 votes
Jayashree Shetty Oct 28, 2013

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

0 votes
Jayashree Shetty Oct 28, 2013

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

Rodolfo So Aug 28, 2018

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

0 votes
Jayashree Shetty Oct 28, 2013

It worked . Thank you so much.

Tarun Sapra Community Leader Oct 28, 2013

would be nice , if you upvote my anwers :)

0 votes
Mary Mark Nov 29, 2018

Hi

i am facing the same problem As mentioned in the post. In order for the parent to auto close, I add the post function to the sub task workflow to the close transition. In the parent workflow I add the subtask blocking condition to the close transition. When subtask is close my parent ticket is still in open status 

 

the workflow is open - triage - in progress - completed - close

 

do I need to add the post function to the open, triage and in progress transitions? 

 

Thanks

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Next-gen

Introducing subtasks for breaking down work in next-gen projects

Teams break work down in order to help simplify complex tasks. This is often done iteratively, with tasks being broken down into smaller tasks and so on until the work is accurately captured in well-...

1,004 views 13 15
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you