Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to sum custom fields in parent issue ?


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,

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!


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).

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

@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!

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.


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

@Bill Sheboy  the rule working as i expect.



Thanks !!

Like Bill Sheboy likes this

Suggest an answer

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

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

611 views 21 25
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you