Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How to sum custom fields in parent issue ?

Jonathan Santos Community Leader Jan 04, 2022


Hi everyone, i am trying create an automation rule but unsuccessfully.
I need tu sum a value in a custom field (numeric) in a sub-tasks.
Sub-task 1 Custom field (Imputación Real) = 5
Sub-task 2 Custom field (Imputación Real) = 3
Parent Issue (Story) Custom field (Imputación Real) = 8

when update the field in a subtask, automatically update custom field in parent issue

{{#=}}{{{issue.parent.customfield_10058)}+ {{triggerIssue.customfield_10058}}}{{/}}


How do I know the name of the custom field?


where is failed?


Thanks !

2 answers

1 accepted

0 votes
Answer accepted

Hi @Jonathan Santos 

First thing, you appear to have too many curly brackets around the smart values.  There should be 2 around each term, such as:

{{#=}} {{issue.field_A)} + {{issue.field_B}} {{/}}

More importantly, are you certain this is what you want to do in this rule?  This will add the value to the parent every time it changes, growing larger every time.

Or, do you want the parent to contain the sum of the values in the subtasks?  To do that, I recommend a different approach to re-compute the sum when any subtask changes:

  • trigger: issue field changes for your custom field
  • condition: issue type is subtask
  • action: lookup issues with JQL to get all of the subtasks of the parent
    • parent = {{triggerIssue.parent}}
  • branch: on the parent issue
    • action: edit the field with the sum of your field
      • {{lookupIssues.customfield_10058.sum|0}}

Kind regards,

Jonathan Santos Community Leader Jan 04, 2022

Hi @Bill Sheboy 



I did what you told me but not successfully.
The sum of automation edit the field a 0



Story (Parent Issue) Custom field = 0


Subtask (custom field = 1)


I wonder if there is an problem with the field type being parsed correctly.  Is it numeric or text field?

Perhaps try this instead:

  • {{lookupIssues.customfield_10058.value.sum|0}}

Also, would you please post an image of your audit log showing the details from the rule running?  That may reveal what is happening.  Thanks!

Jonathan Santos Community Leader Jan 04, 2022


I send what you ask for


That is interesting as Lookup Issues should now support custom fields.

After the lookup issues action, please try writing these two values to the audit log, and then post that image of the audit log after trying to run the rule again:

  • {{lookupIssues.first.key}} : {{lookupIssues.first.customfield_10058}}
  • {{lookupIssues.last.key}} : {{lookupIssues.last.customfield_10058}}

As your story only has two subtasks, that should write the key and custom field value for subtasks CA-14 and CA-15 (not necessarily in that order).

Jonathan Santos Community Leader Jan 05, 2022

Hi @Bill Sheboy  

do what you told me


but it shows me the following error


the field is  customfield_10059

Try another automation rule, which so far works fine,in which I use the story points field to add the values and thus add in the custom field


I will continue to try your help
Thank you

Jonathan Santos Community Leader Jan 05, 2022

@Bill Sheboy

In the audit log i see is adding a. after the existing value in the custom field:


I see some extra spaces in your smart value after the first and last terms.  Try removing the extra spaces from the smart value and see what happens.  Thanks!

Jonathan Santos Community Leader Jan 11, 2022

Hi Bill I remove the extra spaces 


I run the rule , but not sum 



what is mi error?

Thanks !!

In your image, it looks like there is only one curly bracket before lookupIssues.  Please make sure they are in pairs around the smart value and try it again.

0 votes
Jonathan Santos Community Leader Jan 12, 2022

Hi @Bill Sheboy 

now if you are adding the two values.
Thanks for your help and patience.
You are a great colleague



@Jonathan Santos is the rule now working as you expect?  Or is there another issue?


Like Jonathan Santos likes this
Jonathan Santos Community Leader Jan 12, 2022

@Bill Sheboy  the rule working as i expect.



Thanks !!

Like Bill Sheboy likes this

@Bill Sheboy Been following this for an automation that I have running. The challenge that I am running into is that I am adding several fields in subtasks and summing them in the parent. I have all number fields, I have 0 as the default value in all. If I input one number into just one of the fields, the automation says successful, but it still reads 0. If i input numbers into 2 fields, it works. Why would that be?

Hi @Rich Nuzzi 

First thing: only people following this thread may see your question, so for older posts consider creating a new question and add a link to the older ones for context.

Would you please post images of your complete rule, including details of the field addition, and of the audit log showing details of an execution?  That may provide some context for what is happening.

Thanks, and kind regards,

Suggest an answer

Log in or Sign up to answer
Site Admin
Community showcase
Published in Jira Software

An update on Jira Software customer feedback – June 2022

Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...

5,045 views 18 32
Read article

Atlassian Community Events