Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can i sum original estimate from sub-tasks to a parernt?

Rafael Gonçalves Leal January 29, 2024

I'am trying to sum original estimate field from sub-tasks to parent but isnt work.

 

My automation rule:

Captura de tela 2024-01-29 113324.png

Tarefa_ and Bug_ are sub-tasks types.

 

My tests:

Captura de tela 2024-01-29 113504.pngCaptura de tela 2024-01-29 113530.pngCaptura de tela 2024-01-29 113553.png

 

Rule Logs:

Captura de tela 2024-01-29 113625.png

I'am getting a success status but the field doesnt update.

2 answers

1 accepted

1 vote
Answer accepted
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, 2024

Hi @Rafael Gonçalves Leal -- Welcome to the Atlassian Community!

I do not believe all of the subtask issues' fields are loaded into that smart value.  One way to check that is to change your expression to this smart value:

{{issue.subtasks.timetracking.originalEstimateSeconds.sum.divide(60)}}

The Original Estimate smart value is the human-readable one, and cannot be summed.

 

If that works, great!

If not, instead try using JQL to gather the subtasks for the parent issue, loading them into a Lookup Issues action.  Then sum with this:

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

 

Kind regards,
Bill

Rafael Gonçalves Leal January 29, 2024

It worked very well Bill, thank you so much!!

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.
January 29, 2024

Awesome!

Which one did you use, the first or the second one?

 

Like Rafael Gonçalves Leal likes this
Rafael Gonçalves Leal January 29, 2024

First one!

 

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.
January 29, 2024

Thanks; that is useful info for the future.  Even though I suggested that approach...

When looking at the data for a single issue (to check any available smart values) those fields for the subtasks are not loaded:

https://<yourinstanceurl>/rest/api/2/issue/<issuekey>?expand=names

I recently read a backlog item from Atlassian that indicated each reference to an issue in {{issue.subtasks}} by an automation rule leads to a REST API call for each issue!  And so that must be how the data gets dynamically loaded.

 

Rafael Gonçalves Leal January 30, 2024

Its good to know about this api. Thanks!

Like Bill Sheboy likes this
Rafael Gonçalves Leal February 23, 2024

Hi @Bill Sheboy 

The automatition is still working but i notice a problem. For some reason the Sum of orignal estimate is getting duplicated:

Captura de tela 2024-02-23 172237.pngCaptura de tela 2024-02-23 172305.png

I found that the that is duplicating is that:

Captura de tela 2024-02-23 172423.png

Captura de tela 2024-02-23 173042.png

The values of those prints are different because they are from diferent tests

I tried to divide that field per 2 in the automation but i got that problem:
Captura de tela 2024-02-23 172704.png

The rule:

Captura de tela 2024-02-23 172901.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.
February 23, 2024

I do not believe that field, aggregatetimeoriginalestimate, is meant to be set as it is calculated dynamically.  Instead only the original estimate or remating estimate can be set.

Would you please post an image of your current, complete rule and the actions?

Rafael Gonçalves Leal February 26, 2024

Captura de tela 2024-02-26 080557.pngCaptura de tela 2024-02-26 080610.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.
February 26, 2024

When setting the original estimate, the units of measure must be provided.  For example:

{{issue.subtasks.timetracking.originalEstimateSeconds.sum.divide(60)}}m

Adding the "m" on the end to indicate minutes.

 

Like Rafael Gonçalves Leal likes this
Rafael Gonçalves Leal February 27, 2024

No changes. My original estimate field is working well. The problem is the Σ Original estimate. I've found that it's doubling because it's summing the original estimate from subtasks and the original estimate from the history (that is a sum of original estimate from subtasks, which I did with this automation). So maybe we don't need to use an automation to sum up the subtasks' original estimate because the field Σ Original estimate already sums everything up. The problem is that I think it's not possible to show this field on the layout screen.

 

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

It is possible to add that field to the board and backlog for a Company-managed project.  Have you tried to add it?

Rafael Gonçalves Leal February 29, 2024

Yes, i tried that:

Captura de tela 2024-02-29 084434.pngCaptura de tela 2024-02-29 084615.pngCaptura de tela 2024-02-29 084906.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.
February 29, 2024

My apologies as I should have actually tested that: it appears the field can be added but it does not display.  Here is a suggestion to fix that: https://jira.atlassian.com/browse/JRACLOUD-79341

A work-around would be:

  • add a custom field which can be added to the issue view
  • add automation rules, triggered on time logging and changes to the time tracking fields which will update the custom field when the issue (or its children) change
Rafael Gonçalves Leal February 29, 2024

It would be the same rule that you told me to do before but with a custom field? I tried that but doesn't work. The field got the value changed to 0. What is the type of the custom field that i need to use?

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

If you wanted it as people-friendly, such as "2d 4h", the custom field would be text type. 

I would need to see the specifics how you are setting the field to comment on any problems with the value (if a text field does not work).

0 votes
Salim GOMRI February 20, 2024

I used in my own custom field:

 

{{issue.subtasks.timetracking.originalEstimateSeconds.sum.divide(60)}}

 

and it works properly 

Suggest an answer

Log in or Sign up to answer