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

Sum the original estimate field of a parent (epic, task, story) from subtasks

Maxime May 27, 2024 edited

Hello everyone,

I would like to sum the original estimate field of a parent (epic, task, story) from subtasks. My automation works for weeks, days and hours but not for minutes :(

And for exemple, if I have 2 tickets with 35m and 25m it will not sum and add 1h.
Do you have a solution for that ?


Thank you !

Sum original estimate Jira automation.png

2 answers

1 vote
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 27, 2024 edited

Hi @MaximeDu74 

Have you confirmed the values in the lookup results match what you expect?  For example, you could write all of the values to the audit log to check them:

original estimate values: {{#lookupIssues}}{{key}}:{{Original Estimate}}; {{/}}

 

Update: please see the end of this thread for a better solution.  I'm striking-out this one.

Next, the way your rule is written, it uses the human-readable smart value for Original Estimate (e.g., 35m) and lets the expression automatically convert to seconds.  Perhaps try using the specific smart value for the seconds value:

{{lookupIssues.timetracking.originalEstimateSeconds.sum.divide(3600)}}

 

Kind regards,
Bill

Maxime May 27, 2024 edited

Hello @Bill Sheboy 

Thank you for your reply.

The value in the lookup results match what I expect. If I have 3 tickets with : 1d 2h; 1h; 0m, I will have in the parent 1d 3h.

 

I tried to modify the "edit issue" with what you told me but it didn't work (see the screenshot).
Jira edit issue.png

I checked in the log with the code you gave me. For ticket GOUV-42 I have 5400, which is correct and equals 1h 30m. But the 30m is not added to the parent :(

Jira log.png

 

Thank you for helping me,

Maxime

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

Update: please see the end of this thread for a better solution.  I'm striking-out this one.

How about this: remove the divide by 3600 and add the units of measure of seconds:

"{{lookupIssues.timetracking.originalEstimateSeconds.sum}}s"

I hypothesize there is some truncation happening and this would confirm / resolve that. 

Maxime May 27, 2024

Now, I have this problem, and the sum still doesn't work for minutes but works for hours/days/weeks.

Jira error.png Jira edit issue 1.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.
May 27, 2024

After experimenting a bit I confirmed three things:

  • when the time tracking Original Estimate and Remaining Estimate values are set with JSON, they are always in integer minutes
  • passing a unit of measure does not alter that behavior
  • passing a non-integer value causes it to "floor" the value down to the nearest integer

And so this JSON will correctly set the value from the lookup values:

{
"fields": {
"timetracking": {
"originalEstimate" : "{{lookupIssues.timetracking.originalEstimateSeconds.sum.divide(60)}}"
}
}
}

 

I will go back and strikethrough my earlier, incorrect suggestions.

Maxime May 28, 2024

Hello @Bill Sheboy ,

This solution doesn't work. 2h (child) => 3w (parent). I tried to modify "divide(60)" with "divide(3600)" but the minutes are not record.

I don't know how to manage this problem...

 

Thank you,

Maxime

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

These cases work for me with Jira Cloud automation rules.  If your rule matches what I have described, I am unclear what else to check.

At this point, please work with your Jira Site Admin to submit a ticket to Atlassian Support to take a look at your rule: https://support.atlassian.com/contact/#/

Maxime May 28, 2024

Okay thank you for your time. I'll be in touch. I'll add their reply here.

0 votes
Hannes Obweger - JXL for Jira
Atlassian Partner
May 28, 2024

Hi @MaximeDu74

I trust that you'll be able to resolve this using Jira Automation!

Just as food for thought: If you are open to solutions from the Atlassian Marketplace and want to save some Automation budget, there's also a number of apps available that can help with this. Depending on your exact use case, some app will be a better fit than others, but it might be worth some research.

As an example, estimate sum-ups are easily possible using the app that my team and I are working on, JXL for Jira.

JXL is a full-fledged spreadsheet/table view for your issues that allows viewing, inline-editing, sorting, and filtering by all your issue fields, much like you’d do in e.g. Excel or Google Sheets. It also comes with a number of advanced features, including support for (configurable) issue hierarchies, issue grouping by any issue field(s), sum-ups, or conditional formatting.

With these, you can build a view like e.g. this in just a couple of clicks: 

epic-original-estimate-sum-up.gif

As you can see above, the summed up original estimates would update live as you enter your values.

This is really just one of a virtually endless number of possible views and reports: You can also view, group, and sum-up any other issue fields, configure different sum-up styles (like min, max, or average), etc. etc. All this just works - there's no scripting or automation whatsoever required.

Any questions just let me know,

Best,

Hannes

Maxime May 28, 2024

Hello @Hannes Obweger - JXL for Jira ,

Thank you for your reply but I would like a free solution, it's why I want to use Jira Automation.

Like • Hannes Obweger - JXL for Jira likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events