Summing Estimated Mandays from Subtasks to Tasks and Epics in Jira

Thibaut LEGRAND -HONGQIAO- October 20, 2023

Hello Atlassian Community,

I am currently working on optimizing our Jira board and would appreciate some assistance with a specific automation task. I've successfully set up automation rules to sum the estimated mandays from subtasks into their parent tasks. However, I'm facing challenges when it comes to aggregating the estimated mandays from tasks into the associated epics.

Here's the scenario:

  1. Subtasks have estimated mandays.
  2. These subtasks are linked to parent tasks.
  3. Parent tasks are part of epics.

Subtasks have estimated mandays.
These subtasks are linked to parent tasks.
Parent tasks are part of epics.
I've got the automation in place to calculate the sum of estimated mandays from subtasks into their respective parent tasks using Jira Automation. This works perfectly. Now, I'd like to take it a step further and sum the estimated mandays from these parent tasks into the associated epics automatically.

I've explored various automation options, but I haven't found a solution that accomplishes this seamlessly. Has anyone successfully implemented a similar workflow in Jira?

I'd appreciate any guidance, insights, or solutions you could share to help me achieve this. If you have experience with Jira Automation rules or know of a third-party app or script that can assist with this, please let me know.

Thank you in advance for your help!

2 answers

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 20, 2023

Hello @Thibaut LEGRAND -HONGQIAO- 

Can you show us the automation you used to sum up the data from subtasks to parent tasks? With a few changes, the same type of rule should be able to be used for summing from those tasks to their parent Epic.

Thibaut LEGRAND -HONGQIAO- October 21, 2023

Hello ! 

For sure, this one is working, this one is working. 

Screenshot 2023-10-21 201804.png

This one is not working 

Thibaut LEGRAND -HONGQIAO- October 21, 2023

And this one is not working Screenshot 2023-10-21 202107.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 21, 2023

Please show us the Audit Log for an execution of the rule that does not work, and the details of the Edit Issue action.

Thibaut LEGRAND -HONGQIAO- October 23, 2023

Hello, 

 

here is the edit action 

Screenshot 2023-10-23 160801.png

 

and here is the audit log, it show success but the filed's value is still empty 

Screenshot 2023-10-23 160913.png

 

Thank you very much 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 23, 2023

Hello @Thibaut LEGRAND -HONGQIAO- 

When we ask to see the Audit Log for an execution of the rule we need to you to click on the Show more link to the right of the entry and show us the details that reveals.

 

{{issue.tasks...}} is not a valid smart value. You can't reference the child issues of an Epic in that manner.

When Jira does not recognize your smart value reference it does not always tell you that is the real problem. Instead it will sometimes just use that reference with no value attributed to it. That would explain why your field in the Epic is not getting set.

Instead what you need to do is add a Lookup Issues action inside your For Epic branch.

Screenshot 2023-10-23 at 12.48.11 PM.png

 

After that action you can reference the sum of a field in the found issues using a smart value like this:

{{lookupIssues.Estimated Mandays.sum}}

Like Bill Sheboy likes this
Thibaut LEGRAND -HONGQIAO- October 24, 2023

Hello, 

This where i am now, i'm still trying to sum the task of 1 and 11 in the epic 6. The value of 1 and 11 is also the sum of subtasks in these tasks 

Screenshot 2023-10-25 103544.png

using the automation below 

Screenshot 2023-10-25 103853.png

the logs is successfull but for some reasons i ignore the sum on the epic remain unchanged 

Screenshot 2023-10-25 104239.png

 

Screenshot 2023-10-25 104437.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.
October 25, 2023

Hi @Thibaut LEGRAND -HONGQIAO- 

I am adding to Trudy's ideas and jumping in to try to help...

Looking at your current rule, I see some issues and want to suggest some things to try:

  1. You first noted you have a  rule that correctly sums Subtasks to Tasks.  And now you want to sum Tasks to their Epic parents.  Yet your rule is not checking the issue types before it proceeds.
  2. The rule edits the Epic's fields without checking if there were any results from the Lookup Issues, which could result in a null (versus a 0) value
  3. The rule lookup is using the Epic Link field, but that field is sunsetting and so parent should be used
  4. The rule is clearing the Epic Link field as part of the edit!  Why is that happening?
  5. Smart values are name, spacing, and case-sensitive, and they do not always match the name of the field on the screen.  It is unclear if you have the correct smart value for the "Estimated Mandays" field.  That can be checked using this how-to article: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

 

To help, here is an example rule to try, with some notes for things for you to confirm.  I suggest disabling your current rule and to create this as a new one.

  • trigger: value changes for "Estimated Mandays" field
  • condition: issue type equals Task
  • action: lookup issues using JQL
    • parent = {{triggerIssue.parent.key}} AND issueType = Task
  • branch: on Epic (parent)
    • action: edit the "Estimated Mandays" field using the drop-down list and not JSON edit, using the smart value you confirm from step 5 above, to replace yourSmartValue below.
      • {{lookupIssues.yourSmartValue.sum|0}}

Please note: this rule can be triggered by your other rule (which sums Subtasks to Tasks).  And so in the details of this rule, the option "Allow Rule Trigger" needs to be enabled.

Kind regards,
Bill

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2023

@Bill Sheboy 

I think your example rule has an error, if you are trying to sum up from child issues to the parent Epic.

  • trigger: value changes for "Estimated Mandays" field
  • condition: issue type equals Task
  • action: lookup issues using JQL
    • parent = {{triggerIssue.key}} AND issueType = Task  <<<<<
  • branch: on Epic (parent)
    • action: edit the "Estimated Mandays" field using the drop-down list and not JSON edit, using the smart value you confirm from step 5 above, to replace yourSmartValue below.
      • {{lookupIssues.yourSmartValue.sum|0}}

At <<<<< I believe "parent={{triggerIssue.key}}" is incorrect if your intention is to get the parent Epic of the trigger issue.

 

@Thibaut LEGRAND -HONGQIAO- 

Similarly this step in your rule

Screenshot 2023-10-25 at 9.33.29 AM.png

...is not correct for getting all the child issues of the Epic that is the parent of the issue that triggered the rule.

 

When the trigger issue of the rule is a child issue of an Epic, then the correct JQL to retrieve all the child issues of that Epic would be:

"Parent" = {{triggerIssue.parent.key}}

Like Bill Sheboy 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.
October 25, 2023

Thanks, Trudy!  I fixed my earlier post :^)

Like Trudy Claspill likes this
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 26, 2023

@Michael WANG 

If the audit log says "no actions performed" that means the rule was triggered but some condition in it is not being met.

Without seeing the current structure of the rule it is pointless for us to guess at the cause.

You say you can't upload images to the post but you haven't told us what steps you are executing to do that nor what the response is that indicates the upload is not working. Therefore we can't suggest a solution for that either.

Michael WANG October 26, 2023

yes yes, i am still trying to upload the pictures. i will write the steps below.

When: Value changes for "Estimated Mandays"

Issue filelds condition: Issue Type is one of Story, Task

Related issue condition: Epic exists

Actions: Then Lookup issues - search for issue using JQL "Parent" = {{triggerIssue.parent.key}}

Branch rule: For Epic (parent), 

    Actions: Edit issue fields: "Estimated Mandays" {{lookupIssues.Estimated Mandays.sum|0}}

 

thanks @Trudy Claspill 

Michael WANG October 27, 2023

finally, i can upload the pictures. @Trudy Claspill   could you help us check it? thanks a lot.

 

22.png

Michael WANG October 27, 2023

@Trudy Claspill   additional information, i tried to manually edit the "Estiamted Mandays" of the user story within the epic, and this rules works, before that, we updated the "Estitmated Mandays" of the user story with an automation rule (sum up the subtask of the user stories) which may not trigger the this rule. Could you confirm it? and do you have any suggestion or solution for that?  thanks a lot.

33.png

Michael WANG October 27, 2023

@Trudy Claspill @Thibaut LEGRAND -HONGQIAO-  thank you guys, the problem is solved.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 27, 2023

Just to close the loop on this in case others find this thread - 

If the action that should trigger your rule is an action that is actually completed by the execution of another rule, then in your current rule on the Rule Details page you. have to check this box.

Screenshot 2023-10-27 at 3.21.05 PM.png

 

By default this box is unchecked for rules.

Example:

Rule #1 sums up values from subtasks and updates FieldA in their parent Story

Rule #2 has a trigger for "When FieldA changes..."

On Rule #2 the above box needs to be check if you want that rule to run in response to the change made by Rule #1.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 27, 2023

I'm glad you were able to solve the issue @Michael WANG and @Thibaut LEGRAND -HONGQIAO- 

If the guidance in this Answer helped you, please consider having @Thibaut LEGRAND -HONGQIAO-  click on the Accept Answer button.

0 votes
Michael WANG October 26, 2023

Hello @Trudy Claspill ,

i updated our automation with @Thibaut LEGRAND -HONGQIAO-  like this,  but it says "no action performed" according to the audit log.

Michael WANG October 26, 2023

i dont know why. but i can't upload pictures here.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events