Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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 Champion
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 Champion
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 Champion
April 2, 2024

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

Rasa
Contributor
May 4, 2025

Hi Dexter de Vera

i add your suggested HTML code and it work but the value of smart fields are not shown in email and it is emptyScreenshot 2025-05-05 090728.png

can you help me please.

how i replace {{issue.custom_field_1.value}} with my custom field?

Suggest an answer

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

Atlassian Community Events