Automation For Jira - Writing a rule that sends an email with the list of open issues per team in a Roadmap Plan

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 which will send an email containing the list of open issues within an Advanced Roadmap plan, and separated by Team involved in the plan.

Let's assume that:

  • You are using Advanced Roadmap to manage a plan where issues are assigned to different teams, as illustrated below:

    Illustration shown in screenshot below
  • You are a project manager responsible for this plan, and you would like to get a daily summary by email showing 2 separate lists open issues (1 list for each team)

    The automation rule described in this article will cover this use case.

Solution

Preliminary steps

First, we need to prepare the JQL queries which will be used to identify the list of opened issues for each team.

Due to the Advanced Roadmap limitation described in the feature request JQL Search for Team does not Recognize Team Names, it is not possible to write a JQL query to search for issues using the Team Name. Instead, the JQL query relies on the Team ID.

Because of this limitation, it is necessary to retrieve from the Jira DB the ID of each team, using the SQL query below:

1 select * from "AO_82B313_TEAM";

In the example below, we can see that:

  • the ID of "Team 1" is 3

  • the ID of "Team 2" is 2

    Example

As a result, to get the list of opened issues (=unresolved issues) for each Team, the JQL queries below will be used in the Automation Rule:

  • List of opened issues from "Team 1" (ID = 3, as per the Database query)

    1 Team = 3 AND resolution is empty
  • List of opened issues from "Team 2" (ID = 2, as per the Database query)

    1 Team = 2 AND resolution is empty

Rule configuration details

The rule will be configured as described below:

  • Add the Scheduled trigger with the settings below:

    • Frequency: Once per day

    • Select the option simply run the conditions and actions without providing issues

  • Add the Lookup issues action with the JQL below ( make sure to adjust the query based on the Team ID retrieved from the Database):

    1 Team = 3 AND resolution is empty
  • Add the Create variable action with the parameters below. Note that Variable names can only include alphabetic characters.

    • Variable Name: backlogTeamOne

    • 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 below ( make sure to adjust the query based on the Team ID retrieved from the Database):

    1 Team = 2 AND resolution is empty
  • Add the Create variable action with the parameters below. Note that Variable names can only include alphabetic characters.

    • Variable Name: backlogTeamTwo

    • 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 settings below:

  • In More Options, untick the option Convert line breaks to HTML line breaks

    Untick the option
  • To: Choose the recipient of your choice

  • Subject: You can use the suggestion below:

    Backlog from each Team

  • Content: You can use the suggestion below, which will list all the issues along with their URL and summary, and divided by Team

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 <h2>Backlog from each Team</h2> <h3>Backlog from Team 1</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> {{backlogTeamOne}} </tbody> </table> <h3>Backlog from Team 2</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> {{backlogTeamTwo}} </tbody> </table>

Screenshot of the rule

Rule screenshot

Example of email sent by the rule

Email sent by the rule

Updated on May 31, 2024

Still need help?

The Atlassian Community is here for you.