JIRA Automation: Grouping Issue Data Under A Parent via Email

Alex November 13, 2024

Hi All -
Hoping to get help with something a little more complicated. I am querying all "critical issues" in a project. All of that works well for me. I can report the necessary fields for each issue via email - ultimately showing all critical issues & and the fields I am calling.

What I am wondering is if anyone has a clever way to group each critical issue under their parent as a header in a single email. The end result would look something like this:

Parent ABC

  • Issue 123 | Status | Data1 | Data 2
  • Issue 246 | Status | Data1 | Data 2

Parent DEF

  • Issue 789 | Status | Data1 | Data 2
  • Issue 579 | Status | Data1 | Data 2

 

I have done something similar to this before, but each parent had its own email, and iterated through it's children individually.

2 answers

0 votes
Doreen Undiri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 13, 2024

Hi. @Alex 

Try  set up a rule with a Schedule Trigger and use a JQL query like project = "YourProjectKey" AND priority = Critical (this will fetch all critical issues). Then, add a Lookup Issues action with the same JQL to gather these issues

Now In the email, try to use smart values to dynamically group issues by their parent. Here’s an example for the email body:

{{#lookupIssues}}

{{#if(parent.key)}}

Parent: {{parent.key}} - {{parent.summary}}

{{/if}}

- {{key}} | {{status.name}} | {{customfield_12345}} | {{customfield_67890}}

{{/}}

 

This will iterate through the issues, display the parent as a header, and list all its child issues below it. (Replace customfield_12345 and customfield_67890 ) with the IDs for the fields you need.

Test n see if it works , googluck!


Dd

 

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 13, 2024

Hi @Alex 

One way I have seen to do that unfortunately requires adding a "sort key" custom field to all of the issues, allowing the parent (e.g., Epic) to appear before their child issues.  That custom field would be set by another automation rule prior to the need for reporting.

Gather the issues with Lookup Issues with JQL and ORDER BY that sorting, custom field, and then use conditional logic on the issue type for the different formatting styles in your message body.

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events