Forums

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

Smart value for sum of original estimate always returns 0

Tobias Sjöndin
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 9, 2024

I cannot get this to work in our environment and I've exhausted the ways in which I can express the problem into google.

The following is my test trigger to see what values I get from the smart value, which always resolves to 02024-02-09-163019_827x875_scrot.png As can be seen in the following audit output

oie_xrSUbjloU8lr.png

The automation has identified the correct parent Story, which has plentiful sub-tasks and original estimates.

The smart value used is mentioned in many threads regarding similar issues, often with a / 60, but since I was only interested in seeing any value, that has been omitted in the manual trigger.

 

2 answers

1 accepted

0 votes
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.
February 9, 2024

Hi @Tobias Sjöndin 

There are two potential problems with your rule...

Your smart values are incorrect as they should use the time tracking data: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--issue.timetracking--

And so first try this:

{{issue.subtasks.timetracking.originalEstimateSeconds.sum}}

 

If that does not work...I do not believe all of the subtask data is fully loaded with a parent issue.  (There is some uncertainty with this one, as I have read when a rule accesses the subtasks smart value, each issue access leads to a REST API function call to load the data.)

The fix for that would be to use the Lookup Issues action to gather the subtasks for the parent, and then sum with this:

{{lookupIssues.timetracking.originalEstimateSeconds.sum}}

 

Automation tip: 

To find the smart values and structure of attributes available to a rule, try calling the REST API functions to examine a rule.  This can also help with...Smart values are name, spacing, and case-sensitive.  And often the smart value does not match the displayed field name on the issue views.  These steps help identify the correct smart value (and custom field id) for fields.

The essential steps are:

  • identify an issue which has your field(s)
  • call a REST API function with a browser to search for your issue:
https://<yourinstanceurl>/rest/api/2/issue/<issuekey>?expand=names
  • search on the page for your field, such as with CTRL-F
    • if you find the field, you will also find the smart value, custom field id, and structure / attributes it has
    • if you do not find the field, it may not be supported by automation rules

 

Kind regards,
Bill

Tobias Sjöndin
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 10, 2024

Hi @Bill Sheboy and thank you, you first suggestion worked nicely, though with the addition of a division to get it in minutes!

{{#=}}{{issue.subtasks.timetracking.originalEstimateSeconds.sum}}/60{{/}} 

 Truly, thank you!

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.
February 10, 2024

I am glad to learn that helped.

And...to avoid the extra math expression wrapper, you can divide inline:

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

 

0 votes
Walter Buggenhout
Community Champion
February 9, 2024

Hi @Tobias Sjöndin,

I don't think you need the {{#=}} and {{/}} tags here.

Hope this helps!

Suggest an answer

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

Atlassian Community Events