Automation: Fill the Estimate of Epic with the Sum of all issues within the Epic.

Jeroen Mares
Contributor
February 24, 2021

Hi

The original estimate of an Epic is always the sum of all sub issues of this epic for us.

Same goes for the remaining. 

I had assumed I could fill this value easily using Automation but it seems the original estimate field is not available in the fields selection in the create rule interface.

 

How can I achieve this behavior, using Automation? 

So

If original estimate is changed 

Update Linked Epic with sum of all issues of this epic

 

Thank you

3 answers

4 votes
Luis Plaza
Contributor
December 9, 2021

Captura de pantalla de 2021-12-09 14-37-26.png

Hi @Jeroen Mares !

can you try this rule and see if it fits your needs?

Luis

danken00
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!
February 2, 2022

This worked, nice stuff!

Like # people like 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.
February 2, 2022

Thanks for the update to the post.  This technique was not possible last year as Lookup Issues only supported about a dozen fields.  Now the lookups include all issue fields.

Kind regards,
Bill

Like Deleted user likes this
Shachar Tzuk-Bazak July 6, 2022

Hey @Luis Plaza

Thank you for this - worked like a charm. 

By applying the same logic, what will be the lookup value for subtasks>tasks/stories? 

Thanks! 

Like # people like this
Yaniv
Contributor
January 29, 2023

Hi @Luis Plaza ,

First, thank you for your help.

second, I did exactly what you showed here and it doesn't work for me.

I'll appreciate your assistance.

 

Summary:

I'm update "Original Estimation" of a sub-task.

I've automation that sum all the estimation and update the Story.

Now, I want automation that sum all stories and update Epic and it doesn't work for me.

 

It seems like, when story updated automatically, there is no trigger.

 

No_Actions_Performed.jpg

 

Story2Epic.jpgSubtask2Story.jpg

Like # people like 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.
January 29, 2023

Hi @Yaniv Bernhard -- Welcome to the Atlassian Community!

Are you observing that one rule triggers on a sub-task field change, and then updates the parent story's field...that another rule does not trigger for the story's change?

If so, that is the default behavior to prevent rules accidentally triggering each other.  When you want the actions of one rule to trigger another rule, update the details of the dependent rule to Allow Rule Trigger, as described here: https://support.atlassian.com/cloud-automation/docs/create-and-edit-jira-automation-rules/#Edit-the-details-of-a-rule

Kind regards,
Bill

Like # people like this
Yaniv
Contributor
January 31, 2023

Thank you!!

It worked :)

Like Bill Sheboy likes this
Oleksandr Kuzmin April 3, 2023

Hi, @Bill Sheboy

Could you please help.
In my case your example didnt work, Epic estimate didnt filled.
I get next error:
Screenshot at Apr 03 19-30-20.pngScreenshot at Apr 03 19-31-39.png
 

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.
April 3, 2023

Hi @Oleksandr Kuzmin -- Welcome to the Atlassian Community!

Smart values are name, spacing, and case-sensitive.  I note that you used {{issue.EpicName}} but the correct smart value is:

 {{issue.Epic Name}}

When in doubt of a smart value, please try this how-to article to find the correct name for the supported smart values: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Kind regards,
Bill

Oleksandr Kuzmin April 4, 2023

@Bill Sheboy 


thank you so much.
Now it is works.

Like Bill Sheboy likes this
3 votes
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.
February 24, 2021

Hi @Jeroen Mares 

Please take a look at this example rule in the automation library.  This one is for story/sub-task summing, and you may alter the condition, branch, and edit so it works children of epics.

https://www.atlassian.com/software/jira/automation-template-library/rules#/rule/1371692

Also when writing rules, if you cannot find the name of a smart value (or if it is supported), please try a call to the REST API with an example story to check the JSON.  Here is the how-to for that method:

https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/

If you need more help, please post an image of your rule and that will help the community give you ideas.  Thanks!

Best regards,

Bill

Ilija Sasic
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!
September 13, 2021

Hi BIll,

Thanks for the comment, 

I wonder if there is a documentation that describes the actual properties which we can use... example, behind the first link you posted there is this... expresssion? :

{{#=}}{{issue.subtasks.remaining estimate.sum}} / 60{{/}}

and it works fine when you have story and subtasks in it...

but when I use it for epic, it doesn't work. automation process is sucessful but it simply doesn't do anything...  so, I assume that issue.subtasks is the problem.. Do you know which property is used for child issues for epic?

example: epic>child issues (tasks, stories, bugs)

{{#=}}{{issue.children.remaining estimate.sum}} / 60{{/}}

 

thanks

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.
September 13, 2021

Hi @Ilija Sasic 

First...to your question about documentation: I know of nothing that completely, and up to date, describes all of the smart values and attribute values.

Next, sub-tasks are special, and have a some extra coupling to their parent which allow this type of summation.

Epic relationships to their children work differently, and so there is no built-in summation mechanism.  To make matters more interesting, the way epics associate to children is different in company-managed and team-managed projects: epic link versus parent (respectively).

The work-arounds people try are:

Kind regards,
Bill

Ilze Leite-Apine
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.
September 13, 2021

Hi, 

here is Ilze from eazyBI for Jira app support.

If you want to dig deeper in reporting on epics taking into account data from stories and sub-tasks, you may check out the app where this is out-of-the-box ability.

See example report in our demo account: Issue epic Gantt chart 

epics and stories.png

The report shows data on the epic level: they automatically include logged hours and story points from epic's stories and sub-tasks. If you expand epics, you would see the linked story and sub-task issues and their respective values.

Feel free to contact support@eazybi.com for furthers questions.

Best, 

Ilze, eazyBI Customer Support Consultant

Tugba Kucukatalay September 8, 2023

Hi @Bill Sheboy ,

This way is not working for me. Could you help me? I wrote it with blank

{{issue.Epic Name}}

1.pnglog.png

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.
September 8, 2023

Hi @Tugba Kucukatalay -- Welcome to the Atlassian Community!

For the JQL used with Lookup Issues, you are inside the Branch on Epic (Parent) at that point in the rule.  Thus the "current issue" is the one which is the epic.

Please try changing that JQL to this:

"Epic Link" = "{{issue.key}}"

Kind regards,
Bill

Tugba Kucukatalay September 8, 2023

Hi,

Thank you Bill for your help Now it reflects the original estimate of Epic :)

Tugba Kucukatalay September 8, 2023

Hi Bill,

 

Now it was updated but if I changed any time estimate regarding issues. The original estimate of Epic is not refreshed (just 1-time original estimate registration is filled automatically). Why could it not be renewed?1.png2.png

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.
September 8, 2023

Are you noting the value for the epic update is incorrect?

If so, please post an image showing the details of the Edit Issue action as that may explain what is happening.

Jonathan Rudd
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!
November 17, 2023

Hi @Bill Sheboy

 

I hope you can help. I'm using the following rules but I just appears to clear the epic estimate to 0m no matter what has been entered in the tasks:

 

image.png

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.
November 17, 2023

Hi @Jonathan Rudd -- Welcome to the Atlassian Community!

First thing...for older threads like this, I recommend creating a new question and linking back to the older one.  That will get the most visibility to the community; only the people following this one will see it otherwise.  Thanks!

Back to your question...

What version of Jira are you using: Cloud, Server, or Data Center?

Next, I notice some extra spaces in your smart value expression to update the fields, after the sum function calls.  Please try removing those and re-test.

Finally, one of your trigger conditions includes Issue Created.  That trigger can fire so quickly that the issue data is not yet available for the rule.  This can cause expected results in the other rule steps.  I recommend always adding the Re-fetch Issue action immediately after that trigger; this will slow down the rule by about one second and reload the data before proceeding.

Kind regards,
Bill

Jonathan Rudd
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!
November 17, 2023

Hi Bill thanks for the reply.

 

We're using the Cloud version. I've implemented the changes recommended but still have the same behaviour.  Looking at the audit log it appears the lookup fails to find any tasks.image.png

image.png

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.
November 17, 2023

With the changes to the Epic fields, including the transition of "Epic Link" to "parent" I suspect that is the cause.  (The original announcement indicated this would not impact automation rules using the old field, but I have my doubts...)

Also..."Epic Link" should only work for a company-managed project.  For team-managed, the epic/child relationship uses the "parent" field.

Please try making this change to your rule for the Lookup Issues JQL as it will work for either project type:

parent = "{{issue.key}}"

 

0 votes
MaximeDu74 May 24, 2024

Hello everyone, thank you for your solution, it works for me but for the minute. So, it sums up correctly the subtask but not the minutes. I can't see them in my epic. I have weeks, days and hours but not minutes. And for exemple, if I have 2 tickets with 35m and 25m it will not sum up and add 1h.
Do you have a solution for that ?
Thank you !

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, 2024

Hi @MaximeDu74 -- Welcome to the Atlassian Community!

As this is an older thread, please create a new question to provide more context and ensure the maximum number of people see it to offer suggestions.

When you create your question, please include the following:

  • what problem are you trying to solve; that is, "why do this?"
  • an image of your complete automation rule, in one continuous image
  • images of any relevant trigger, actions, branches, conditions
  • an image of the audit log details, showing the rule execution
  • an explanation of what is not working as expected, including specific examples

Thank you.

Kind regards,
Bill

MaximeDu74 May 27, 2024

Thank you Bill, I just posted on a new thread

Suggest an answer

Log in or Sign up to answer