Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Project Automation Email

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

0 votes
Answer accepted
Hana Kučerová Community Leader Nov 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>

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 Nov 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?

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

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 Hana Kučerová likes this

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

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
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you