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

Next challenges

Recent achievements

Recognition

  • Give kudos
  • My kudos

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

{{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

2 answers

0 votes

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

0 votes
Preston I'm New Here Jul 28, 2020

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!

Suggest an answer

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

5 mobile apps for Jira Cloud to boost productivity

  It’s very important to have access to the workflow process from anywhere. Especially if you manage the work of others. There is no difference whether you’re out of office, or drive a ca...

284 views 2 5
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