Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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 (Epic) to done when tasks are done

Hello,

I am trying to create a rule to transition a parent (epic) if all tasks are done by doing this:

Jira Aut_01.png

When I moved the last task to done to trigger this rule, it does not take action on the parent. I don't think is getting to then. I'm doing something wrong or I'm missing something, help please. Thank you!

1 answer

1 accepted

1 vote
Answer accepted

Hello @Jorge 

 

Thanks for writing to us. You want to work on all types of subtasks(stories, bugs, tasks, etc) present in an Epic, for that you will have to use Epic(parent) branch condition which loops over all the issues(linked or child tasks) present in this epic. In your case, parent -> sub-task relation did not hold true hence it did not work as you expected.

I would recommend to plan rule like this:

Screen Shot 2020-07-24 at 12.01.01 pm.png

 

Hope this helps!

Cheers
Sherry

Hi Sherry,

Thank you for your answer. I made the changes and still there was no action happening.  So I went and read in more detail your suggestion and check why, the parent I was using was not the right one, EPIC(Parent) once I changed that, worked. Now, the workflow has a rule to include time spent before moving to done so now I will need to add all the time spent of the tasks in the epic and update the timeSpent field  ;)

Thank you for your help,

JorgeJira Aut_03.png

 

Hi Sherry,

I'm entering this code in the "Then" part of the script but is giving me an error indicating: Invalid type duration entered. Any suggestions on how I can get the sum of all the time spent of each task in the epic? 

{
"update": {
"worklog" : [
{
"add": {
"timeSpent" : "{{now.diff(issue.created).businessDays}}d"
}
}
]
}
}Jira Aut_04.png

 

Thanks,

Jorge

Hi @Jorge 

For finding sum of worklogs in an epic, there is an article published: https://community.atlassian.com/t5/Automation-articles/How-to-sum-up-logged-hours-using-automation-in-Jira-Cloud/ba-p/1409115
You can refer above article and in the comment you can see how we can do it in an epic(which sums up original estimate of all stories inside epic set it to parent epic. 
I would suggest to go for separate rule with trigger as "When Value Changes".

But in your case if you want to calculate "time spent" on the basis of dates created and date marked as done, the way you are doing is fine. I think issue is with the smart value.
Try using: "{{issue.created.diff(now).businessDays}}d" (Your case is generating negative value and worklog can not take negative time spent)

I would recommend to use "Log Work" action(at last in your rule) over setting it in json. Looks more clearer, readable and easy to edit. Something like this:

Screen Shot 2020-07-27 at 11.39.17 am.png

Hope this helps!

Cheers
Sherry

Like Sebastian Mühleis likes this

Hi,

I came a cross a scenario where this rule is not performing as expected. Let me describe my situation I hope it make sense:

I have a jira board for development and a kanban board for QA. So far I have done automation to clone an issue from the dev's board to the kanban. Once QA moves the clone task to done, then a rule will be triggered and will move the linked issue (original) to done as well. So all this works wonderfully if they are 1 to 1. 

My last scenario is when I have an epic and it's in progress, one subtask gets ready for QA it gets duplicated, wonderful, then QA finishes moves the cloned to done, then the  original subtask moves to Done, perfect but then this subtask should trigger again the rule and get the epic parent move to Done as well since all children tasks are done.

Should I duplicate the rule and see if it gets triggered and moves the Epic Parent of the original subtask to done as well? 

Sherry Goyal Atlassian Team Sep 13, 2020

Hello @Jorge 

 

Maybe you can refer rule here: https://docs.automationforjira.com/rule-playground/index.html#/rule/112177/12212069 which does something similar to closing parent tasks if all child tasks are done. IF this still not resolves, please share your rule and audit logs so that I can take a look.

 

Cheers
Sherry

Hi Sherry,

Thank you for your reply and help. I did the changes, following the rule and there is something wrong, I get an error. Attach is the screenshot so you know what I'm entering. Maybe I have entered something wrong but I cannot see where. Thank you again for your help.

Jira Issue - Sep 14 2020.png

Sherry Goyal Atlassian Team Sep 14, 2020

Hello @Jorge 

Seems like in your case parent-child relationship does not hold true, that's why "For Parent" branch condition is failing. Can you try choosing "Epic(Parent)" from drop down instead of "Parent" to find the epic? Also, the condition "Sub-tasks match" , maybe you can try "Stories (or other issues in this Epic)" instead if that fits your use case.

 

Thanks
Sherry

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

4,564 views 12 8
Join discussion

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