Creating a list of open subtasks in an automation table that lists all parent tickets

Christy Kennedy March 13, 2024

Here is the goal of my Automation:

Every Friday, I want to send an email that contains a table listing all issues in the statuses "Compliance Approval", "On Hold", or "Awaiting approval". Each issue should show in a separate row of the table. (I have this working successfully).

 

Problem:

I am running into problems when I want to include a list of all open subtasks for each of the parent issues in their respective rows. I assume I need to use {{lookupIssues}}, but I cannot figure out how to associate the open subtasks with their parent tickets when adding them to the table.


 

Here is what the table looks like in the email:

 

Email Table.png


 

 

Here is the Automation I made:


Automation.png


 

And here is the HTML I use to create the table (I left the cell for Open Subtasks blank - that is where I need help):


<style type="text/css">
.tg {border-collapse:collapse;border-spacing:0;}
.tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
overflow:hidden;padding:10px 5px;word-break:normal;text-align:center;} /* Added text-align:center; */
.tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;text-align:center;} /* Added text-align:center; */
.tg .tg-582d{background-color:#63B9BE;border-color:inherit;color:#FFF;font-weight:bold;text-align:center;vertical-align:middle}
.tg .tg-0lax{text-align:left;vertical-align:top}
</style>
<table class="tg">
<thead>
<tr>
<th class="tg-582d">Issue Summary</th>
<th class="tg-582d">Date Created</th>
<th class="tg-582d">Issue Status</th>
<th class="tg-582d">Open Subtasks</th>
</tr>
</thead>
{{#lookupIssues}}
<tr>
<td class="tg-c3ow">{{summary}}</td>
<td class="tg-c3ow">{{created.mediumDate}}</td>
<td class="tg-0pky">{{status.name}}</td>
<td class="tg-0pky"> </td>
</tr>
{{/}}
</table>

 

1 answer

1 accepted

0 votes
Answer accepted
Kalyan Sattaluri
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.
March 13, 2024

Hello @Christy Kennedy  Welcome.

When I tried to log below, I am getting the open subtasks

{{#lookupIssues}}{{#subtasks}}{{#if(equals(status.name,"To Do"))}}* {{key}} , {{summary}}{{/}}{{/}}{{/}}

 

Using that I have tried to update your email template but havent tried it. Can you check and let us know..

<table class="tg">
<thead>
<tr>
<th class="tg-582d">Issue Summary</th>
<th class="tg-582d">Date Created</th>
<th class="tg-582d">Issue Status</th>
<th class="tg-582d">Open Subtasks</th>
</tr>
</thead>
{{#lookupIssues}}
<tr>
<td class="tg-c3ow">{{summary}}</td>
<td class="tg-c3ow">{{created.mediumDate}}</td>
<td class="tg-0pky">{{status.name}}</td>
<td class="tg-0pky"> {{#subtasks}}{{#if(equals(status.name,"To Do"))}} *{{key}}{{/}}{{/}}{{/}}</td>
</tr>
{{/}}
</table>

 

Christy Kennedy March 13, 2024

Thanks for the help @Kalyan Sattaluri I implemented this, but am getting the below error:

 

Error rendering smart-values when executing this rule

Christy Kennedy March 13, 2024

Specifically it says 

 

Mismatched start/end tags: null != in template-[id number]

Kalyan Sattaluri
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.
March 13, 2024

Oops. Please remove one of the closing paranthesis. Can you try below:

<table class="tg">
<thead>
<tr>
<th class="tg-582d">Issue Summary</th>
<th class="tg-582d">Date Created</th>
<th class="tg-582d">Issue Status</th>
<th class="tg-582d">Open Subtasks</th>
</tr>
</thead>
{{#lookupIssues}}
<tr>
<td class="tg-c3ow">{{summary}}</td>
<td class="tg-c3ow">{{created.mediumDate}}</td>
<td class="tg-0pky">{{status.name}}</td>
<td class="tg-0pky"> {{#subtasks}}{{#if(equals(status.name,"To Do"))}} *{{key}}{{/}}{{/}}</td>
</tr>
{{/}}
</table>
Christy Kennedy March 13, 2024

Thanks! No errors this time, but the cells in the email table for "Open Subtasks" are just empty :(

I confirmed that there are subtasks in the "To Do" status on this project.

Kalyan Sattaluri
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.
March 13, 2024

Hmm, Can you confirm what is the actual name of the status of Open sub-tasks. We call it as To Do.

Is yours  the same or is it different?

 

Christy Kennedy March 13, 2024

The status options are "To Do" and "Done".

Kalyan Sattaluri
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.
March 13, 2024

I just tested and it seemed to work for me including the email part.

Can you, after your lookup action and Before your email action, put a log action statement with below value and share your audit log screenshot.

{{#lookupIssues}}{{#subtasks}}{{#if(equals(status.name,"To Do"))}}* {{key}} , {{summary}}{{/}}{{/}}{{/}}

Please see my screenshots below:

image.png

 

Below is the email i got with open subtasks listed in my example:

image.png

Christy Kennedy March 13, 2024

Aha! I changed it to find open subtasks using the resolution field instead. It worked :) 

 

<td class="tg-0pky"> {{#subtasks}}{{#if(equals(resolution, EMPTY))}} *{{key}}{{/}}{{/}}</td>

 

Christy Kennedy March 13, 2024

Thanks again for all your help @Kalyan Sattaluri !

Like Kalyan Sattaluri likes this
Kalyan Sattaluri
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.
March 13, 2024

Awesome. Please consider accepting the solution so others researching in the future can benefit. Thanks!

Suggest an answer

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

Atlassian Community Events