JIRA Automation Mail Table not having border and styling Issue

Pawan Choure May 27, 2022

Hi Team, We are trying to generate an HTML format email with tabular data, and given below is the code for the same

 

1) How to get border added to the table

2) How to add background color

3) Control the styling aspect (Width of column)

 

We checked the HTML markup option but the wiki has only an option for the font if we add the manual table styling in getting applied but not working with lookupIssues.

 

https://support.atlassian.com/cloud-automation/docs/convert-wiki-markup-to-html-or-plain-text-in-jira-automation/

 

Sample Mail without border and styling support.Capture.PNG

Send Email Option Content:

Hey Team, we still have the following issues left to complete this sprint:
<br><br>
<p> Total number of Open Issues are {{lookupIssues.size}} </p>
<table>
<tr style="border: 5px solid black">
<th style="text-align: left">Assignee</th>
<th style="text-align: left">Summary</th>
<th style="text-align: left">Status</th>
<th style="text-align: right">Last Updated</th>
</tr>
{{#lookupIssues}}
<tr>
<td>{{assignee.displayName.htmlEncode}}</td><td><a href={{url.htmlEncode}}>{{summary.htmlEncode}}</a></td><td>{{status.name.htmlEncode}}</td><td style="text-align: right"><font color="red">{{updated.longDate.htmlEncode}}</font></td>
</tr>
{{/}}
</table>

 

Regards,

Pawan

2 answers

0 votes
Dave Furlani June 5, 2023

I'm not sure where you're going wrong, but this produces a formatted table with borders and background colours for me.

<table cellspacing="0" bordercolor="#B7B7B7" border="1" cellpadding="5" style="font-family:arial align:left;">
<tr BGCOLOR="#DFDFDF">
<th>Sprint</th>
<th>Jira ID</th>
<th>Type</>
<th>Summary</th>
<th>Status</th>
<th>Ver(s)</th>
<th>Epic</th>
</tr>
{{#lookupIssues}}
<tr>
<td>{{sprint.last}} {{sprint.endDate.last.convertToTimeZone("Australia/Hobart").format("dd/MM/yyyy")}}</td>
<td style="white-space:nowrap"><a href="{{url}}">{{key}}</a></td>
<td><font color="{{#if(equals(issueType.name, "Story"))}}#008800{{/}}{{#if(equals(issueType.name, "Bug"))}}#EE0000{{/}}{{#if(equals(issueType.name, "Task"))}}#0000DD{{/}}">{{issueType.name}}</font></td>
<td>{{summary}} </td>
<td BGCOLOR="
{{#if(equals(status.name, "To Do"))}}#EEEEEE{{/}}
{{#if(equals(status.name, "Backlog"))}}#EEEEEE{{/}}
{{#if(equals(status.name, "In Progress"))}}#DBE9FF{{/}}
{{#if(equals(status.name, "Awaiting Review"))}}#DBE9FF{{/}}
{{#if(equals(status.name, "Code Review"))}}#DBE9FF{{/}}
{{#if(equals(status.name, "Sprint Complete"))}}#C0FFDF{{/}}
{{#if(equals(status.name.split(" ").first, "UAT"))}}#C0FFDF{{/}}
{{#if(equals(status.name.split(" ").first, "Done"))}}#C0FFDF{{/}}
">{{status.name}}</td>
<td>{{fixVersions.name}}</td>
<td><a href="{{epic.url}}">{{epic.key}}</a> {{epic.summary}}</td>
</tr>
{{/}}
</table>

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.
May 27, 2022

Hi @Pawan Choure -- Welcome to the Atlassian Community!

Such HTML features are apparently not supported, and you could submit a suggestion for Atlassian to add them.  When I checked I did not find any open suggestions for this idea in the public backlog.

I remember trying this same thing a while ago, and I just tried again and confirmed your results for Jira Cloud's automation rules.

Kind regards,
Bill

Pawan Choure May 27, 2022

@Bill Sheboy 

When I create a normal table with formatting it works only when I use lookupIssues formatting doesn't work isn't that strange. 

Is there any way to view the result of the HTML generated page in JIRA automation.

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.
May 30, 2022

For your use case of creating a formatted email, the only way I can think of is to instead set that body text to a different plain text, custom field, and then export to see what happens.

Suggest an answer

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

Atlassian Community Events