Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,296,731
Community Members
 
Community Events
165
Community Groups

{{issue.comments.last.body}} not working correctly in HTML email notifications.

Hi,

We are using Automation for JIRA SD cloud and I have currently setup alert email notifications that are set to be HTML.  I'm using {{issue.comments.last.body}} within the body of the email and it is not coming through correctly even though everything is set as HTML.  Only the {{issue.comments.last.body}} field appears to have this issue.   The email come through ok with the other components but as soon as that field value is placed within the email it is showing all HTML tag/formatting as text for any values of that field.

Have you seen this before?  

Thank you,
Larry

3 answers

Very late comment on this item but I came across it whilst faced with the same issue.  In case someone else follows the same path, I ended up using the below which worked as expected:

{{issue.comments.last.body.html}}

 

NB I needed to uncheck "Convert line breaks to HTML line breaks" to ensure spacing was as desired.

Are your emails displaying something like this?

 

{color:#fdsgds} Hi there {quote}

{quote} {quote}

 

When it should look like this:

 

Hi there

 

If that's the issue you're having, I'm having the same thing and ended up using

{{issue.comments.last.body.replaceAll("\{.*?\}","")}}

That just replaces anything surrounded with { } and it's contents. Works for us as long as no one uses curly braces in their email (which I've never seen before)

 

Cheers!

I haven't seen this before but mail clients showing HTML source rather than processed HTML usually occurs if the HTML isn't valid.

Since the comment is used directly by default, you could try escaping the comment? Something like:

{{#htmlEncode}}{{issue.comments.last.body}}{{/}}

should do the trick

Thanks for the reply Mark,

I gave this a shot and unfortunately it was still coming through in the same manner.   I've just changed everything to standard text for now to clean it up.  

Cheers,

Larry

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

Marketplace Partner Spotlight: AppLiger

This month the spotlight is on AppLiger. We caught up with Pavel Pavlovsky, CEO and Product Manager, to learn how the company started and what fuels the team's creativity.    Atlassian:...

369 views 0 7
Read article

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