...
With the Preview Context and Template rendering features you can validate correct behaviour up front, saving time!
Example templates
Identifying recent attachments to notifications
Adding all attachments from an issue to a template could be problematic if a large quantity of attachments where present on an issue. The following script can be used to identify if attachments where recently added to the issue.
Template
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 the difference in time and store as a date object
#set($difference = $jemhDateUtils.getDate($timeNow - $jemhDateUtils.getDate($created).getTime()))
##create a new date 5 minuets ahead of '0'
#set($targetTime = $jemhDateUtils.addMinutes($jemhDateUtils.getDate(0), 5))
##check if difference is before five minuets
#if($difference.before($targetTime))
<h3>$attachment.filename.asText()</h3>
<p>$attachment.content.asText()</p>
#end
#end
#end
#end |
How it looks
...
Related articles
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 5 |
---|
spaces | JEMHC | showSpace | false |
---|
sort | modified |
---|
typeshowSpace | pagefalse |
---|
reverse | true |
---|
labelstype | template webhook velocitypage |
---|
cql | label in ( "velocity" , "template" , "webhook" ) and type = "page" and space = "JEMHC" |
---|
labels | template webhook velocity |
---|
|
...