Multiple Tables in an Automated Email One Does Not Format

Tom Scoggin
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.
January 11, 2024

I have about 4 or 5 tables that are rendered in an automated email. The tables are based on status. Everything works perfectly except the Status for Done. That table does not render correctly. I pulled the code and ran it using the status id for Done and then ran the exact same code with the id for To Do.

When I changed it to the To Do status id the table rendered correctly. With the same code using the id for Done it does not render correctly. I know I have the correct id because I put the field in the table.

Any thoughts why Done renders incorrectly but the other tables work fine?

2 answers

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.
January 12, 2024

Hi @Tom Scoggin 

Looking at what you have posted, I wonder: are you doing this in an Automation for Jira rule or by some other automation mechanism?

And, are you using Jira Cloud, not the Server or Data Center versions?

 

If so, I recall a conversation with Atlassian Support from a couple of years ago that the {{issues}} smart value is not supported for Cloud, only for Server / Data Center versions.  The context of that support call was why not all fields / data were supported in {{issues}}...it is because it is a coincidence / accident the smart value is visible in Cloud, but the contents are not defined / documented for Cloud.

Instead either Lookup Issues or a web request response message are used for bulk-handling of issue data.

 

Kind regards,
Bill

0 votes
Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 11, 2024

@Tom Scoggin Can you share what you are using to render the tables in your automation?  Can you share a screenshot as well?

Tom Scoggin
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.
January 12, 2024

This is the code. As you can see I'm having trouble keeping each table format consistent in the email.

Tables image.JPG

<style>
tbody, th, td {
border:1px solid black;
border-collapse:collapse;
}
</style>

<br>
To Do<br>
<br>

<table>
<tbody>
<tr>
<th Style="width:80px">Issue Type</th>
<th Style="width:80px">Issue Key</th>
<th Style="width:125px">Title</th>
<th Style="width:90px">Created</th>
<th Style="width:90px">Updated</th>
<th Style="width:180px">Status</th>
<th Style="width:50px">Unit</th>
<th Style="width:400px">Last Comment</th>
<th Style="width:75px">Days Since Last Update</th>
</tr>

{{#issues}}

{{#if (status.id.eq(10000))}}
<tr>
<td>{{issueType.name}}</td>
<td>{{key}}</td>
<td>{{summary}}</td>
<td>{{created.format("MM/dd/yyyy")}}</td>
<td>{{updated.format("MM/dd/yyyy")}}</td>
<td>{{status.name}}</td>
<td>{{CPT}}</td>
<td>{{comments.last.body}}</td>
<td>{{updated.diff(now).days.abs}}</td>
</tr>
{{/}}
{{/}}
</tbody>
</table>

<br>
In Progress Table<br>
<br>

<table>
<tbody>
<tr>
<th Style="width:80px">Issue Type</th>
<th Style="width:80px">Issue Key</th>
<th Style="width:125px">Title</th>
<th Style="width:90px">Created</th>
<th Style="width:90px">Updated</th>
<th Style="width:180px">Status</th>
<th Style="width:50px">Unit</th>
<th Style="width:400px">Last Comment</th>
<th Style="width:75px">Days Since Last Update</th>
</tr>

{{#issues}}
{{#if (status.id.eq(3))}}
<tr>
<td>{{issueType.name}}</td>
<td>{{key}}</td>
<td>{{summary}}</td>
<td>{{created.format("MM/dd/yyyy")}}</td>
<td>{{updated.format("MM/dd/yyyy")}}</td>
<td>{{status.name}}</td>
<td>{{CPT}}</td>
<td>{{comments.last.body}}</td>
<td>{{updated.diff(now).days.abs}}</td>
</tr>
{{/}}
{{/}}
</tbody>
</table>

<br>
Pending External Action<br>
<br>

<table>
<tbody>
<tr>
<th Style="width:80px">Issue Type</th>
<th Style="width:80px">Issue Key</th>
<th Style="width:125px">Title</th>
<th Style="width:90px">Created</th>
<th Style="width:90px">Updated</th>
<th Style="width:180px">Status</th>
<th Style="width:50px">Unit</th>
<th Style="width:400px">Last Comment</th>
<th Style="width:75px">Days Since Last Update</th>
</tr>

{{#issues}}

{{#if (status.id.eq(12737))}}
<tr>
<td>{{issueType.name}}</td>
<td>{{key}}</td>
<td>{{summary}}</td>
<td>{{created.format("MM/dd/yyyy")}}</td>
<td>{{updated.format("MM/dd/yyyy")}}</td>
<td>{{status.name}}</td>
<td>{{CPT}}</td>
<td>{{comments.last.body}}</td>
<td>{{updated.diff(now).days.abs}}</td>
</tr>
{{/}}
{{/}}
</tbody>
</table>


<br>
Awaiting Parts<br>
<br>

<table>
<tbody>
<tr>
<th Style="width:80px">Issue Type</th>
<th Style="width:80px">Issue Key</th>
<th Style="width:125px">Title</th>
<th Style="width:90px">Created</th>
<th Style="width:90px">Updated</th>
<th Style="width:180px">Status</th>
<th Style="width:50px">Unit</th>
<th Style="width:400px">Last Comment</th>
<th Style="width:75px">Days Since Last Update</th>
</tr>

{{#issues}}

{{#if (status.id.eq(11441))}}
<tr>
<td>{{issueType.name}}</td>
<td>{{key}}</td>
<td>{{summary}}</td>
<td>{{created.format("MM/dd/yyyy")}}</td>
<td>{{updated.format("MM/dd/yyyy")}}</td>
<td>{{status.name}}</td>
<td>{{CPT}}</td>
<td>{{comments.last.body}}</td>
<td>{{updated.diff(now).days.abs}}</td>
</tr>
{{/}}
{{/}}
</tbody>
</table>


<br>
Done<br>
<br>

<table>
<tbody>
<tr>
<th Style="width:80px">Issue Type</th>
<th Style="width:80px">Issue Key</th>
<th Style="width:125px">Title</th>
<th Style="width:90px">Created</th>
<th Style="width:90px">Updated</th>
<th Style="width:180px">Status</th>
<th Style="width:50px">Unit</th>
<th Style="width:400px">Last Comment</th>
<th Style="width:75px">Days Since Last Update</th>
</tr>

{{#issues}}

{{#if (status.id.eq(10001))}}
<tr>
<td>{{issueType.name}}</td>
<td>{{key}}</td>
<td>{{summary}}</td>
<td>{{created.format("MM/dd/yyyy")}}</td>
<td>{{updated.format("MM/dd/yyyy")}}</td>
<td>{{status.name}}</td>
<td>{{CPT}}</td>
<td>{{comments.last.body}}</td>
<td>{{updated.diff(now).days.abs}}</td>
</tr>
{{/}}
{{/}}
</tbody>
</table>

Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2024

If you use old-school table formatting like this does it work?

<br>
Done<br>
<br>

<table>
<tbody>
<tr>
<th width="80">Issue Type</th>
<th width="80">Issue Key</th>
<th width="125">Title</th>
<th width="90">Created</th>
<th width="90">Updated</th>
<th width="180">Status</th>
<th width="50">Unit</th>
<th width="400">Last Comment</th>
<th width="75">Days Since Last Update</th>
</tr>

{{#issues}}

{{#if (status.id.eq(10001))}}
<tr>
<td width="80">{{issueType.name}}</td>
<td width="80">{{key}}</td>
<td width="125">{{summary}}</td>
<td width="90">{{created.format("MM/dd/yyyy")}}</td>
<td width="90">{{updated.format("MM/dd/yyyy")}}</td>
<td width="180">{{status.name}}</td>
<td width="50">{{CPT}}</td>
<td width="400">{{comments.last.body}}</td>
<td width="75">{{updated.diff(now).days.abs}}</td>
</tr>
{{/}}
{{/}}
</tbody>
</table>

Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2024

Also what email client are you using? (Outlook, Gmail)   I want to try and recreate it.

Tom Scoggin
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.
January 12, 2024

Outlook. I've tried a lot of different things but I'm still getting mixed results. I also went as far as to set <table width="1180">

Tom Scoggin
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.
January 12, 2024

I found this article but even when I remove the lastComment field I still don't get a consistent table format.

Strange. I may try to run them independently and see if the emails are consistent.

https://jira.atlassian.com/browse/JRASERVER-65047?src=confmacro

Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2024

@Tom Scoggin If you open the emails in Gmail does it have the same issue? I know Outlook has always been known for formatting issues with tables.  

Tom Scoggin
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.
January 12, 2024

It must be Outlook. Google mail shows them all the same.

Nice call.

Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2024

I found some articles about how to try and fix the issue in outlook but it does not always work.  If you google you will find them and could try some of the posted solutions.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events