Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Code Block
titleConditional sending of attachments
#set ($totalLength = 0)    
#foreach ($att in $issue.fields.attachment)
   #set($totalLength = $totalLength + $att.size)

#if ($totalLength < 10000000)
  #foreach ($att in $issue.lastcomment.attachments)
     Attachments are too large for sending with email ($totalLength), please download them from Jira

On line 1 we define a variable $totalLength where we store the total size of specific Jira issue attachments (in line 2).

Then on line 6 we compare the $totalLength against the maximum possible size (10000000 or 10MB)