Project Automation Email

John Wood November 10, 2020

Hi all,

 

I've got an automated email that goes out that grabs multiple issues via a jql query and sends out an email with them all on.

 

It uses {{#issues}} to pass the results into a table, however I also want a header row - so (much cut down) i have:

{{#issues}}
<table>
<tbody>
<tr>
<th>Ref</th>
<th>Title</th>
</tr>
<tr>
<td>{{key}}</td>
<td>{{summary}}</td></tr>
</tbody>
</table>
{{/}}

The issue is that this produces multiple tables, one for each issue, with a header on each table.  Is there any way to combine them to produce a single table with a single header row?

2 answers

1 accepted

4 votes
Answer accepted
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 10, 2020

Hi @John Wood ,

try to change it like this:

<table>
<tbody>
<tr>
<th>Ref</th>
<th>Title</th>
</tr>
{{#issues}}
<tr>
<td>{{key}}</td>
<td>{{summary}}</td>
</tr>
{{/}}
</tbody>
</table>
John Wood November 10, 2020

Thanks @Hana Kučerová 

 

Unfortunately what happens there is that the first issue appears in a table, the rest just appear as text - its the first thing I tried as it seems logical, but no joy

Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 10, 2020

Hmmm, just tested it and it seems to be working... 

Did you try to uncheck the option "Convert line breaks to HTML line breaks"?

There are a lot of line breaks, when the option is checked, maybe that's why the formatting is broken.

Which email client do you have?

John Wood November 10, 2020

Outlook - I didn't consider the email client being the source of the issue after this amendment, I'll have a look at the source of them email and see what is happening

 

edit: Unfortunately if it is the line break thing and that is a setting in the client, not a lot I can do about it as there are loads of recipients and I cant ask them all to change a setting for this report

 

edit2: Ah I see in the automation section - unfortunately this is Automation for Jira rather than the standard automation, and it doesn't seem to have that option, and I dont think there is an option for using a schedule rather than having a trigger in normal automation

 

edit3: I'm blind, it does have that option, testing now

John Wood November 10, 2020

You're a legend :)

 

After all that it was indeed that it was converting line breaks, which I should have realised as I'd had to change the code from being nicely laid out to all a big block of code to make it not insert line breaks all over the place!

Like # people like this
Pavithra Venkateshaiah June 14, 2023

Im unable to get the table form with issue and details 

Like Ben Krichko likes this
Ben Krichko August 29, 2023

I too have tried to follow the HTML formatting, but no table or values are populating. 

0 votes
Rens Bruil November 10, 2020

Depends on how {{#issues}} is replaced, is it an array of some sort or did you already construct it like a table. 

John Wood November 10, 2020

Ah that sound promising - no I only create the table in the email body field, it isn't being passed through as a table or anything (didnt know this was possible)

 

The settings are:

  • "run a JQL search and pass results to subsequent conditions and actions"
    • project = CHANGE AND issuetype in ("Normal Change", "Urgent Change") AND status = "Approved for Rollout" AND "Requested Window Start" >= 0d AND "Requested Window Start" <= 1d ORDER BY cf[15128] ASC
  • Process all issues produced by this trigger in bulk (needs to be on or sends multiple emails)

Are you saying there is a way to have it passed through as a table to start with, something in the jql?

 

I should probably have said, this is using "Automation for Jira" Add-on, I thought it was just called "Project Automation"

Suggest an answer

Log in or Sign up to answer