Page tree
Skip to end of metadata
Go to start of metadata

Problem: You want to notify reporters about changes happened to their tickets during the last 24 hours. The notification should be sent every work day on 12 PM.

Solution: On Raley Emails Notifications homepage click button Add Notification. Give it a meaningful name and choose Custom scheduled in JIRA event combobox. A new text input will appear on the right from the JIRA event combo - this is the place where you specify when this notification will actually work in crontab format.

We'll use www.cronmaker.com to generate the right CRON expression to fit our requirements. The resulting expression should be:

0 0 12 ? * MON,TUE,WED,THU,FRI *


In the next step, we're going to define a JQL rule that will define a subset of issues that will be sent with this notification. The following example shows how the JQL looks like when we need to notify about issues in project ABC or XYZ:


(project = ABC or project = XYZ) and updated > -24h

You can fine-tune this expression using JQL filter in your Jira issues navigator. Once you're satisfied with the result - paste it into JQL rule textbox in Raley Notifications. As a result, your current notification configuration should look like following:



Next step is to specify the subject for email message. Note, that unlike with other issue events - subject for custom scheduled does not accept variables from issues, i.e. your subject line must be constant and it will be the same for all recipients.

Assuming, that we need to notify Reporters, our configuration could look like this:

Raley will automatically group issues by relevant Reporters and every reporter will only receive those issues where he or she is the actual assignee of the ticket.


The final step is to define message template. We'll use Template Wizard to make it simpler. Click on the button Template wizard and choose:

Table on the first step

HTML on the second step

Key and Summary in issue field picker.

Click on Next and then Copy & close buttons. Paste your template into the Message Template textarea. Your current message template looks like this:

<table border="1">
    <tr>
        <th style="padding: 5px">Key</th>
        <th style="padding: 5px">Summary</th>
    </tr>
    #foreach ($issue in $issues)
    <tr>
        <td style="padding: 5px">$issue.key</td>
        <td style="padding: 5px">$!issue.fields.summary</td>
    </tr>
    #end
</table>


We will add two columns at the end of the table - the first will show changes in fields and the second - newly added comments. Amend your template, like this:

<table border="1">
    <tr>
        <th style="padding: 5px">Key</th>
        <th style="padding: 5px">Summary</th>
        <th style="padding: 5px">Changes</th>
        <th style="padding: 5px">Comments</th>
    </tr>
    #foreach ($issue in $issues)
    <tr>
        <td style="padding: 5px">$issue.key</td>
        <td style="padding: 5px">$!issue.fields.summary</td>
        <td style="padding: 5px">
        	<table border="1">
        		<tr>
        			<th>Field</th>
        			<th>From</th>
        			<th>To</th>
        		</tr>

        		#foreach ($history in $issue.changelog.histories)        		        		
	     			#if ($jirassimo.isAfter($history.created, $context.yesterday))	     			
    	    			#foreach ($item in $history.items)
    	    				<tr>
        	    				<td>$item.field</td> 
	        	    			<td>$item.fromString</td>
    	    	    			<td>$item.toString</td>        				
        					</tr>
        				#end
      				#end
	  			#end
  			</table>
        </td>
        <td style="padding: 5px">
        	<table border="1">
        		<tr>
        			<td>Who</td>
        			<td>When</td>
        			<td>Comment</td>
        		</tr>
        		
        			#foreach ($comment in $issue.fields.comment.comments)
      					#if ($jirassimo.isAfter($comment.created, $context.yesterday))
      						<tr>
        						<td>$comment.author.name</td>
        						<td>$jirassimo.formatDate($comment.created, "dd MMM yy hh:mm")</td>
        						<td>$comment.body</td>
        					</tr>	
      					#end
   					#end
   			</table>
        </td>        
    </tr>
    #end
</table>


In lines 12 - 32 we're outputting all the changes to the fields that happened from yesterday and on lines 33-51 we show all the new comments added since yesterday.

Congratulations, you've just configured your second digest notification!

  • No labels