Versions Compared

Key

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

...

Code Block
$context.issue.key.asText()
$jemhUtils.setCommentRendered()
#set($attachments = $context.issue.fields.attachment)

##If there are attachments present on the issue ...
#if($attachments)
    ##record current time
    #set($timeNow = $jemhDateUtils.nowDate().getTime())
    ##for each attachment....
    #foreach($attachment in $attachments)
        ##retrieve the time the attachment was added to the issue
        #set($created = $attachment.created)
        ##if not null
        #if($created.asText())
            ##gt##get the number differenceof milliseconds inbetween timenow and storethe asattachment abeing dateadded
object             #set($difference$timeSinceAdded = $jemhDateUtils.getDate($timeNow - $jemhDateUtils.getDate($created).getTime()))
            ##create##set atime newframe dateto 5 minuets ahead of '0'in milliseconds
            #set($targetTime$timeFrame = 	$jemhDateUtils.addMinutes($jemhDateUtils.getDate(0),(60 * 1000) * 5))
            ##if time since ##checkthe attachment ifwas differenceadded is before five minuets 
  less than or equal to the time frame ...
            #if($difference.before($targetTime)$timeSinceAdded <= $timeFrame)
                <h3>$attachment.filename.asText()</h3>
                <p>$attachment.content.asText()</p>
            #end
        #end
    #end
#end

...