Automation For Jira - Writing a rule that sends daily emails about JSM backlog
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
This article describes how to create an Automation Rule using the Lookup Issues and Create Variable actions (available in Automation for Jira from version 9.0.1). The rule will send an email including various lists of issues from a Service Management project, allowing managers to monitor the health of the queues.
The automation rule provided in this article will generate the lists below:
List of open issues
List of unassigned issues
List of issues waiting on the customer side
List of issues waiting on the support side
Solution
Rule configuration details
The rule will need to be configured as follows:
Add the Scheduled trigger with the settings below:
Frequency: Once per day
Select the option to simply run the conditions and actions without providing issues
Add the Lookup Issues action, with the JQL query below ( NOTE: Replace <JSM_PROJECT_KEY> with the key of the JSM project):
project = <JSM_PROJECT_KEY> AND resolution = Unresolved ORDER BY "Time to resolution"
ASC
Add the Create Variable action, with the parameters below
Variable name: OpenedIssues
Smart value:
1
{{#lookupIssues}}<tr><td><a href="{{url}}">{{key}}</a></td><td><a href="{{url}}">{{summary}}</a></td><td><em>{{assignee.displayName}}</em></td></tr>{{/}}
Add the Lookup Issues action, with the JQL query below ( Replace <JSM_PROJECT_KEY> with the key of the JSM project):
project = <JSM_PROJECT_KEY> AND assignee is EMPTY AND resolution = Unresolved ORDER BY "Time to resolution"
ASC
Add the Create Variable action, with the parameters below
Variable name: UnassignedIssues
Smart value:
1
{{#lookupIssues}}<tr><td><a href="{{url}}">{{key}}</a></td><td><a href="{{url}}">{{summary}}</a></td><td><em>{{assignee.displayName}}</em></td></tr>{{/}}
Add the Lookup Issues action, with the JQL query below ( Replace <JSM_PROJECT_KEY> with the key of the JSM project):
project = <JSM_PROJECT_KEY> AND status = "Waiting for support"
AND resolution = Unresolved ORDER BY "Time to resolution"
ASC
Add the Create Variable action, with the parameters below
Variable name: IssuesWaitingForSupport
Smart value:
1
{{#lookupIssues}}<tr><td><a href="{{url}}">{{key}}</a></td><td><a href="{{url}}">{{summary}}</a></td><td><em>{{assignee.displayName}}</em></td></tr>{{/}}
Add the Lookup Issues action, with the JQL query below ( Replace <JSM_PROJECT_KEY> with the key of the JSM project):
project = <JSM_PROJECT_KEY> AND status = "Waiting for customer"
AND resolution = Unresolved ORDER BY "Time to resolution"
ASC
Add the Create Variable action, with the parameters below
Variable name: IssuesWaitingForCustomer
Smart value:
1
{{#lookupIssues}}<tr><td><a href="{{url}}">{{key}}</a></td><td><a href="{{url}}">{{summary}}</a></td><td><em>{{assignee.displayName}}</em></td></tr>{{/}}
Add the Send Email action, with the parameters below:
In More Options, untick the option Convert line breaks to HTML line breaks
To: choose the recipient(s) of your choice (groups of users, email addresses...)
Subject: JSM project - Daily report
Content
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
<h2>JSM project - Daily report</h2> <h3>Open issues</h3> <table border="0" cellspacing="0" cellpadding="2"> <thead> <tr> <th align= "left">Key</th> <th align= "left">Summary</th> <th align= "left">Assignee</th> </tr> </thead> <tbody> {{OpenedIssues}} </tbody> </table> <h3>Unassigned issues</h3> <table border="0" cellspacing="0" cellpadding="2"> <thead> <tr> <th align= "left">Key</th> <th align= "left">Summary</th> <th align= "left">Assignee</th> </tr> </thead> <tbody> {{UnassignedIssues}} </tbody> </table> <h3>Issues waiting on the support side</h3> <table border="0" cellspacing="0" cellpadding="2"> <thead> <tr> <th align= "left">Key</th> <th align= "left">Summary</th> <th align= "left">Assignee</th> </tr> </thead> <tbody> {{IssuesWaitingForSupport}} </tbody> </table> <h3>Issues waiting on the customer side</h3> <table border="0" cellspacing="0" cellpadding="2"> <thead> <tr> <th align= "left">Key</th> <th align= "left">Summary</th> <th align= "left">Assignee</th> </tr> </thead> <tbody> {{IssuesWaitingForCustomer}} </tbody> </table>
Screenshot of the Rule:
Example of email sent by this rule
Was this helpful?