How do I render a table when sending email in Jira Automation Rule?

Jar Lady
Contributor
March 31, 2024

Hi,

I want to render a table when sending out email in Jira Automation Rule. There should be a border and the table should consist of smart values from the custom fields created in Jira like this:

Heading 1 | Heading 2
Custom field name 1 |   {{issue.custom_field_1.value}}

Custom field name 2 |   {{issue.custom_field_2.value}}

Thank you.

1 answer

0 votes
Dexter de Vera
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 1, 2024

Hi @Jar Lady ,

try to insert this in content:

<table>
<tbody>
<tr>
<th>Heading 1</th>
<th>Heading 2</th>
</tr>
{{#issues}}
<tr>
<td>Custom field name 1</td>
<td>{{issue.custom_field_1.value}}</td>
</tr>
<tr>
<td>Custom field name 2</td>
<td>{{issue.custom_field_2.value}}</td>
</tr>
{{/}}
</tbody>
</table>

And make sure to untick the - Convert line breaks to HTML

image.png

 

Dexter de Vera
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 1, 2024

You can add border by adding style in html.

<style>
table,
th,
td {
padding: 10px;
border: 1px solid black;
border-collapse: collapse;
}
</style>
<table>
<tbody>
<tr>
<th>Heading 1</th>
<th>Heading 2</th>
</tr>
{{#issues}}
<tr>
<td>Custom field name 1</td>
<td>{{issue.custom_field_1.value}}</td>
</tr>
<tr>
<td>Custom field name 2</td>
<td>{{issue.custom_field_2.value}}</td>
</tr>
{{/}}
</tbody>
</table>

 

Jar Lady
Contributor
April 1, 2024

Hi!

I tried to apply the same piece of code above, but I still didn't see the border in my email. 

Dexter de Vera
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 2, 2024

May I see the screenshot of your automation and email received. Thanks!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.20.10
TAGS
AUG Leaders

Atlassian Community Events