Calculate the sum of original estimates of all issue types to an Epic using Automation

66 comments

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 4, 2023

@Laurent use parent instead of epic link. Epic link is deprecated

Like Laurent likes this
Alexander Oks
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 4, 2023

Hi @Alex Koxaras _Relational_

thank you for the nice guide. Unfortunately Step 4 does not work on our side.

There is an error message that suggests using parent instead of Epic Link in the Lookup Issues automation building block, but when it is used it will not return any results. 

Lookup Issues.png

 

When using parent in the Advanced Issue Search I won't get any results neither.

Lookup Issues.png

When hard coding the Epic Link to the Lookup Issues JQL everything works as expected.

Lookup Issues.png

Any suggestions?

 

Best regards

Alex

Like Deleted user likes this
Laurent May 5, 2023

Hi  @Alex Koxaras _Relational_

It's better with the right "parent" use, no more error.

But, as some others, the step 4 doesn't work : the lookup part doen't match any issues so the EPIC is not updated : 

Capture.JPG

 

Is there another parameter to set or something else to do to make it works ?

Thanks

Laurent

Alexander Oks
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 5, 2023

Hi @Laurent

there is a workaround for the situation.

You can use the field ID (cf[10014]) instead of the name (Epic Link) and you won't get the error anymore.

Lookup Issues.png

Best regards

Alex

Like Deleted user likes this
Laurent May 6, 2023

Hi @Alexander Oks 

thank you ! it almost works : it doesn't take subtasks time. 

Do I have to try another branch inside the Epic (parent) to update tasks before ?

 

Thanks

Laurent

Like Deleted user likes this
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 6, 2023

@Alexander Oks @Laurent customfield_10014 is again the "Epic Link". To be honest don't know exactly why your rule isn't working with just the "Epic Link" = ABS-XXX. Try writing this and click "Validate query" to see that your query is legit.

@Laurent the rule isn't meant to add subtasks time to the Epic. Subtasks time is automatically added to parent. My rule only add standard issue types to the Epic.

Like Deleted user likes this
Laurent May 6, 2023

ok thanks for your help @Alex Koxaras _Relational_ 

I'll try to find a way.

Like Deleted user likes this
Miguel Rodriguez May 24, 2023

@Alex Koxaras _Relational_ is this automation for Jira cloud or Data Center? I am project admin in a Data center version of Jira software (as opposed to instance admin) and I cannot find the "Lookup Issues" action when I go to my project automations, and start to create a new rule similar to your example. So it could be that is only on cloud or that maybe it is only available to site admins? 
Thanks. 

Like Deleted user likes this
Bill Sheboy
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 24, 2023

Hi @Miguel Rodriguez 

It appears the lookup issues action is being added to Jira Server/Data Center now, and you can follow the progress on this here: https://jira.atlassian.com/browse/JIRAAUTOSERVER-53

Kind regards,
Bill

Like Deleted user likes this
elramr June 8, 2023

First, thank you! Great work.

Second I want to ask: right now if I open a story add the original estimate and just then add it to the epic,
the epic didn’t calculate the time, just if I add or update the original estimate after the story is linked to the epic.

Is there an option to solve this problem?

Like Deleted user likes this
Deleted user June 17, 2023

@Alex Koxaras _Relational_ I am trying to reconstruct this rule, but I have many errors. Please can you attach the JSON of the rule so that I can import it into my Jira Datacenter? Thank you in advance.

Morten Junker Juul August 1, 2023

The rule works for me, but i think you need to create 1 rule for issue types Task, Bug, Story and use "EPIC Link" = {{issue.key}} in the lookup issue. 

Create another rule, same structure, for sub-task to sum to story, bug or task, and use Parent = {{issue.key}} in the lookup issue, and that should trigger the other rule.

Like Deleted user likes this
Morten Junker Juul August 1, 2023

@Omer Gurtemel 

I tried divide(3600) and it works perfect for hours, but when setting original estimate for minutes, it does not add them to EPIC.

{
"fields": {
"timetracking": {
"originalEstimate" : "{{lookupIssues.Original Estimate.sum.divide(3600)}}",
"remainingEstimate" : "{{lookupIssues.Remaining Estimate.sum(3600)}}"
}
}
}

Like Deleted user likes this
David Leal
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.
August 24, 2023

Thanks for sharing this approach, it really helps, I have seen other solutions to the same problem but it seems they are not working properly. @Alex Koxaras _Relational_  the only comment I have is in regard to the applicability of it, or on which scenario it makes sense to sum the original estimate (durations) up. An epic can have several issue and they can be executed in parallel, Summing the original estimate assumes all the work will be implemented sequentially, but that is not the general situation in real life, you may have several team members working on the epic's children at the same time, so the final duration for the epic will be less than just the sum of all epic's children durations.

Like Deleted user likes this
Morten Junker Juul August 24, 2023

I found a solution for the problem with time divide. Jira is always adding time in seconds when doing it from automation, if i divide by 60 and add m when i paste the value into the field, i am telling Jira the time i am adding is in minutes 

This works perfect for me (adding m in the end, after the smart value)

{
"fields": {
"timetracking": {
"originalEstimate" : "{{lookupIssues.Original Estimate.sum.divide(60)}}m",
"remainingEstimate" : "{{lookupIssues.Remaining Estimate.sum.divide(60)}}m"
}
}
}

 

I have 2 rules, 1 for summarizing time from story to epic, and another rule for summarizing time from sub-task to stories.

Like Deleted user likes this
Kim Ranch Olsen January 2, 2024

Hi @Alex Koxaras _Relational_ 

Thank you for this great post. I have setup the automation rule as discribed (including a minor tweak, adding 'm' for specifying the update in minutes), but it does not work when remaining estimate is reduced via the Log Work action, as illustrated below. In this case, the remaining estimate on the epic is unchanged. However, if I update 'Time remaining', the epic is succesfully updated.

image-20240102-101803.png

 

I hope you can help with some ideas for a solution. I am on a Jira Cloud instance. Here is my rule:

Picture1.png

Picture2.png

Like Deleted user likes this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events