Hello,
I am trying to create a rule to transition a parent (epic) if all tasks are done by doing this:
I
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!
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:
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,
Jorge
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"
}
}
]
}
}
Thanks,
Jorge
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
Hope this helps!
Cheers
Sherry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.