How get average of customfield from all child issues?

Angel
Contributor
December 11, 2024

Hi! 

 

How would I get the average of customfield from all child issues? 

 

Thanks

Regards. 

2 answers

0 votes
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.
December 12, 2024

Hi @Angel 

How often do you need to find the average, how do you want to use it, and what do you mean by "average"?

  • Need the value one time, and want to use the average outside of Jira
    • identify the issues needed, export them, and use a spreadsheet function to perform the calculation
  • Need the value often, and want to use the average inside of Jira issues

 

Regarding the definition of "average":

  • Will all of your child issues have a value for the custom field?
  • If not, how do you want empty values to be used in the calculation?

Typically for spreadsheet tools, and the automation rule average function of lists, empty values are ignored.  For example:

  • story A, with custom field value 1
  • story B, with custom field value 3
  • story C, with custom field value empty
  • story D, with custom field value empty

With an automation rule, the average calculated would be (1 + 3) / 2 = 2 even though there are four stories.  When you need to treat the empty values as 0, the averaged would be (1 + 3 + 0 + 0) / 4 = 1 and that would require a more sophisticated calculation, not using the built-in average function.  Please let me know if you need help writing that one for an automation rule.

 

Kind regards,
Bill

0 votes
Harrison Ponce
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.
December 11, 2024

Hi @Angel , great question here!

I made a sample automation for you. In mine, the trigger is a manual trigger from the parent issue, but it can be any trigger you want.

What I did was add a Lookup issues action that searched for all issues where the parent is equal to the issue key of the trigger issue. Then I added a comment using a smart value for the lookup issues that averages a custom field's value {{lookupIssues.Pricing Estimate.average}}. The middle part of that smart value (mine is "Pricing Estimate") you can replace with whatever the name is of your custom field.

You can use that smart value in another field, in a comment, email, etc.

Hope this helps to get you started!

Screenshot 2024-12-11 at 9.15.38 PM.png

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