Problem: How to create a notification configuration that would send out digest of changes and comments in issues happened since last run of this notification?
Here's how you approach it in Raley:
1) Create a new Notification configuration of type "Jira issues digested messaging".
2) Set the value to Fired on input. This should be a CRON expression that represents when the notification configuration should be run. Use www.cronmaker.com to generate it for you.
For example, the value "0 0 9 1/1 * ? *" means that the notification configuration will be run at 9AM every day. When you enter your cron, Raley will show you when it will be run the next time as follows:
6) Finally, specify a message template. You can use our Template Wizard to simplify generation of the template, just make sure you use Table layout so, issues will be shown as HTML table.
Here's a little example on how to render both, changes made and comments added since the last run of this notification configuration.
#foreach ($issue in $issues) #foreach ($history in $issue.changelog.histories) #if ($jirassimo.isAfter($history.created, $context.last_run)) #foreach ($item in $history.items) $item.field was changed from $item.fromString to $item.toString #end #end #end #foreach ($comment in $issue.fields.comment.comments) #if ($jirassimo.isAfter($comment.created, $context.last_run)) Comment by $comment.author.name: $comment.body #end #end #end
You probably noticed the usage of $context.last_run variable. This variable contains the datetime of last invocation of Scheduled notification configuration, no matter whether there were any emails sent with that invocation or not.
The value in $context.last_run is stored in format yyyy-MM-dd HH:mm and you use $jirassimo.isAfter() helper function to understand if a date in argument 1 is after the date in argument 2.
There are more variables available in $context. To learn about them take a look at Context variables wiki page. To learn more about functions available in $jirassimo check out this page