Forums

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

Automation - Sum Subtask Estimates to Story Not Working

roger_sun July 12, 2023

I followed several articles on how to set a JIRA automation to sum up 'Task Estimates' up to a field on the Story level called 'Groomed Estimate'. Despite the audit log saying success, the 'Groomed Estimate' value remains null. Seeking help!

Rule:
Screenshot 2023-07-12 at 9.49.04 AM.png

Audit Log:

Screenshot 2023-07-12 at 9.49.43 AM.png

Setting Subtask value of 'Task Estimate' to 4:
Screenshot 2023-07-12 at 9.50.48 AM.png

Parent issue / Story field value of 'Groomed Estimate' remains null:
Screenshot 2023-07-12 at 9.51.03 AM.png

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Champion
July 12, 2023

Hello @roger_sun 

Welcome to the community.

An excellent tool to help debug Automation Rules is the Log action. You can use the Log action to print any smart value into the Audit Log of the rule execution.

Try using the Log action to print out the smart value you are trying to assign to your Groomed Estimate field and see if it actually has a value.

Also, what type of fields are Task Estimate and Groomed Estimate?

And from where specifically did you get the idea for using {{issue.subtasks....}}?

roger_sun July 12, 2023

@Trudy Claspill 

Also, what type of fields are Task Estimate and Groomed Estimate?

  • They are both set as Number fields

And from where specifically did you get the idea for using {{issue.subtasks....}}?

Trudy Claspill
Community Champion
July 12, 2023

Thank you for that additional information.

It looks like you are working with issues in a Team Managed project. Is that correct?

I have tried using the {{issue.subtasks...}} smart value in Automation rules for both a Company Managed and a Team Managed project to sum values from a Number field in subtasks to another Number field in the parent issue and it has worked.

What do you get when you print the smart value with the Log action? It is possible that there are multiple fields across the system named "Task Estimate" or "Groomed Estimate" and the Automation is working on the wrong fields. You may have to use the custom field id for one or both of the fields instead.

roger_sun July 12, 2023

It looks like you are working with issues in a Team Managed project. Is that correct?

  • Yup, you are correct

 It is possible that there are multiple fields across the system named "Task Estimate" or "Groomed Estimate" and the Automation is working on the wrong fields. You may have to use the custom field id for one or both of the fields instead.

  • Although we do have several projects, this is the first project using Task Estimate and Groomed Estimate

 

What do you get when you print the smart value with the Log action?

  • Can you share an example of the formula you're suggesting? 
  • I tried the below. The system does recognize that the subtask Task Estimated has updated and has a parent Story. However the parent Story itself seems to not recognize the subtask ID and cannot pull the Task Estimate from it.
  • Screenshot 2023-07-12 at 2.45.00 PM.png
roger_sun July 12, 2023
Trudy Claspill
Community Champion
July 12, 2023

The Log action lets you print any smart value. You can insert into it the exact same smart value you are using to set the Groomed Estimate field.

Screen Shot 2023-07-12 at 12.57.01 PM.png

 

FYI you can't use this syntax to reference a single subtask in the parent issue, nor to loop through the subtasks to print the Task Estimate for each. That why you are not seeing any values printed in the log for this step.

Screen Shot 2023-07-12 at 12.59.11 PM.png

If you wanted to print out the values for each subtask you would need to set up a separate Branch that retrieved all the subtasks under the parent issue.

roger_sun July 12, 2023

@Trudy Claspill hope i did it correctly -- still does not pull the value.Screenshot 2023-07-12 at 3.17.43 PM.png

Trudy Claspill
Community Champion
July 12, 2023

That explains why no value is being set in the Groomed Estimate field. For some reason Jira is unable to generate a sum of the Task Estimate fields for the subtasks of the parent issue.

The next thing I would suggest is use the information here to output the list of all fields for a subtask that uses the Task Estimate field. From that output get the customfield_##### identifier for the Task Estimate field. Substitute that text (customfield_<the actual number>) where you have used Task Estimate in your smart values. Then execute your rule again to see if the output in the log is any different.

Another option is to use a Lookup Issues action to retrieve all the subtasks for that parent, and then sum the values from those results:

{{lookupIssues.Task Estimate.sum}}

roger_sun July 13, 2023

@Trudy Claspill 

 

So i used the custom field ID this time and used the lookupissues formula you provided (w/ customID instead) and still same issue...

"customfield_10131":"Task Estimate"

Screenshot 2023-07-13 at 1.46.20 PM.png 

Trudy Claspill
Community Champion
July 13, 2023

To use the {{lookupIssues}} smart value you must first insert the Lookup Issues action.

Screen Shot 2023-07-13 at 12.31.00 PM.png

roger_sun July 13, 2023

@Trudy Claspill you. are. AWESOME. it works now!

super thank you for your patience -- it is very much appreciated!!

Like Trudy Claspill likes this
Trudy Claspill
Community Champion
July 13, 2023

Did it work with the custom field nomenclature and the Lookup Issues action?

roger_sun July 13, 2023

@Trudy Claspill yup -- here is the final set up. :D Screenshot 2023-07-13 at 3.10.39 PM.png

Like Trudy Claspill likes this
Trudy Claspill
Community Champion
July 13, 2023

I'm glad that it is now working.

Please consider marking the Answer and Accepted to help other users find posts with validated solutions.

Like roger_sun likes this

Suggest an answer

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

Atlassian Community Events