The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How can I fix HTML and add to automation to have email with table - report from tickets fields?

Vera Valshonok
Contributor
July 27, 2023

Hi, dear community!

 

I have created HTML for the Jira automation in order to send an email notification with the table that will show a task link and then take an information from set fields from that link and add to the table.

I believe I would need to prepare such a table separately in HTML and then send ( without automation) as for now I was not able to do it differently.

 

By the code below the table is created, I can add link manually, but the table can not read the Data from the Jira fields and add them to the table. 

Is there any way to do it?

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test Results Report</title>
<style>
/* Add some basic styling to the tables */
body {
font-family: Arial, sans-serif;
line-height: 1.6;
}

table {
font-size: 12px;
border-collapse: collapse;
width: 100%;
}

th, td {
border: 1px solid #ddd;
padding: 8px;
}

th {
text-align: left;
background-color: #ff6802;
color: white;
}

h4 {
margin-top: 20px;
}
</style>
</head>
<body>
<h4>Overall Pass Ratio</h4>
<table>
<tr>
<th>Task</th>
<th>Site Name</th>
<th>System Device Type</th>
<th>System Device Vendor</th>
<th>Serial Number</th>
<th>Warrant End date</th>
<th>Summary</th>
</tr>
<!-- Replace the following line with actual data using your preferred programming language or server-side code -->
<tr>
<td><a href="URL_TO_ENVIRONMENT">...</a></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><a href="URL_TO_ENVIRONMENT">URL_TO_ENVIRONMENT</a></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><a href="URL_TO_ENVIRONMENT">URL_TO_ENVIRONMENT</a></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><a href="URL_TO_ENVIRONMENT">URL_TO_ENVIRONMENT</a></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<!-- Add more rows as needed -->
</table>
</body>
</html>

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Esteban Diaz
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 Champions.
August 14, 2023

Hi @Vera Valshonok

I had a similar situation and I created an automation like this one:

automation8.PNG

This is scheduled to run every Monday morning and sends an Email to an external email address ( it needs no jira user ) and can also be sent to Jira users, agents or customers, and even groups.

 

The the Lookup issues component looks like this and you can include here the JQL used in your filter

automation6.PNG

And in the Send email component you can detail who you want to send the email to and as you can see in the content part I've included some HTML and smart values to create a table with the issues details.

<h1>Weekly Report</h1>

<table border="1">
<tr>
<th>Key</th>
<th>Summary</th>
<th>Status</th>
</tr>

{{#lookupIssues}}
<tr>
<td><a href="{{url}}">{{Key}}</a></td>
<td>{{summary}}</td>
<td>{{status.name}}</td>
</tr>
{{/}}

</table>

 

Let me know it worked 😁

Cheers, 

Esteban Diaz

https://www.linkedin.com/in/estebandiaz/

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events