Forums

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

Sum up the last 60 minutes attachment files via Automation

MIchalis Motis
April 13, 2026

Iam looping all the files and trying to sum up the last 60 minutes files but seems loop [{{issue.attachments}}] to sum up the size of the attachmets it comes empty outisde of the loop


{{totalSize.default(0)}}

loop:
{{#=}}{{totalSize}} + {{attachment.size}}{{/}}
results inside of loop: 500,1000

totalSize comes empty

2 answers

1 accepted

1 vote
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 Champions.
April 14, 2026

Hi @MIchalis Motis -- Welcome to the Atlassian Community!

As Trudy describes, seeing your entire rule and audit log details will provide context for the community to offer better suggestions.

Until we see those...

It appears you are trying to use branching and a Created Variable to iterate over the attachments.  That will not work because of how branches work: processing in parallel and asynchronously over the items, and so a variable would be repeatedly recreated with each pass through the looping.

Instead, you may get the sum of the sizes for the attachments added in the last 60 minutes using a math expression, the long-format of list iteration, and list filtering:

total size of attachments added in last 60 minutes: 
{{#=}}0
{{#issue.attachments}}
{{#if(created.diff(now).minutes.lte(60))}}
+ {{size}}
{{/}}
{{/}}
{{/}} bytes

How that works, describing from the inside toward the outside:

  • we use a long-format iterator over the work item's attachments
  • filtering for any created date within the last 60 minutes
  • and when found, add the size of that attachment
  • wrapping all of that in a math expression, with a default value of 0 at the front to help the summation
  • and add a "bytes" label at the end

Please adjust this as needed depending upon how you want to use the sum value.

Kind regards,
Bill

MIchalis Motis
April 14, 2026

Dear Bill,

Thank you so much! this works from my end. I was thinking to loop via iterration in jira and this would solve my issue if i declare the variable on top. I see your logic and seems very reasonable.

Once again thank you so much for the help :) this does work! 

Best Regards,

Michalis

Like Bill Sheboy likes this
3 votes
Trudy Claspill
Community Champion
April 13, 2026

Hello @MIchalis Motis 

Welcome to the Atlassian community.

Can you provide screen images showing your entire automation rule, please? Sometimes unexpected results are due to the context of the steps.

How are you obtaining the result inside the loop and then determining that {{totalSize}} outside the loop is empty? This could have something to do with the structure of your rule.

Suggest an answer

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

Atlassian Community Events