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

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

Jira Automation: Jira html links show as text in email

Hi all,

I'm using the Jira automation plugin with a html email template I created.

I have noticed that html links which are in description or comments get converted to just text in the email. I guess I understand why this is, because it does not contain the html info.

Is there a way for these links to retain there html formatting? 

Thanks!

2 answers

1 accepted

2 votes
Answer accepted

Hi @Hunter1428 

Would you please provide an example of your automation rule's email content that is not keeping the formatting?  Thanks!

Best regards,

Bill

Hi @Bill Sheboy 

Rule: when ticket enters status submitted send email to x (HTML Format)

I'm using the smart key {{issue.fields.description}} to get the description. When you create/update a ticket with a link in the description, the email is sent. But the hyperlink is not present on the link in the email.

 

Here is the basics of the HTML template:

<table style="margin-left: auto; margin-right: auto;" width="50%" cellspacing="0" cellpadding="0"><tbody><tr><td style="width: 552px; vertical-align: top; text-align: left;"><table style="width: 100%; margin-left: auto; margin-right: auto;" cellspacing="0" cellpadding="0"><tbody><tr><td>&nbsp;</td></tr><tr><td style="background-color: #e0e0e0;"><h3>Description</h3></td></tr><tr><td><hr /></td></tr></tbody></table><table style="width: 100%; margin-left: auto; margin-right: auto;" cellspacing="0" cellpadding="0"><tbody><tr style="height: 13px;"><td style="text-align: left; height: 13px;"><span style="color: #333333;"> {{issue.fields.description}} </span></td></tr></tbody></table></td></tr></tbody></table>

 

Regards

Thanks, @Hunter1428 

Is there any text missing from the Description in the email, or is it otherwise complete?

Have you tried {{issue.description}} removing the fields prefix to see how that impacts the formatting?

Hey @Bill Sheboy 

There is no text missing, all is present in the email.

I just replaced {{issue.fields.description}} with {{issue.description}}, created a new ticket with a HTML link in (confirmed it was a html link by clicking it) submitted the ticket. Received the email and the link is indeed still just text, no HTML :(

Gotcha.  Please try this to force the description to be usable in HTML content:

{{issue.description.htmlEncode}}

Unfortunately did not work.

I created a new rule just to send the description of a ticket with a HTML link and still only shows as text.

Maybe this also helps, bullet point formatting is also strange. Instead of it showing as points or numbers it shows as * instead.

Pic of rule.

image1.JPG

Sorry I missed the issue here..it appears that the automation rule engine does not yet process the wiki markup from the fields in Jira.  Here are the related things in the suggestion backlog:

As a work-around, I have hard-coded my actual HTML in emails within rules.  For example to produce a list of issues from a Lookup Issues action:

Here is the list:
<ul>
{{#lookupIssues}}
<li><a href="{{url}}">{{key}}</a> : {{summary}}</li>{{/}}
</ul>

This means that if you could parse the linked or other formatted information from the Description, you could use HTML to recode it yourself.  Quite the hassle but it might solve the problem for you. 

Like Hunter1428 likes this

No worries, but thanks for the links and list information!

I noticed on https://codebarrel.atlassian.net/browse/AUT-2050 it mentions you can use {{issue.descriptíon.html}}. I tried it and it does work but it's adding double line spacing between each line. Maybe you have an idea?

Hi, @Hunter1428 

Great find!  Two things to try:

Under the email options, I disabled "Convert line breaks to HTML line breaks" and it removed the extra line breaks when I used {{issue.description.html}}

Next, if that doesn't fully work, you could hack-up the converted HTML:

  • First, echo {{issue.description.html}} to the audit log to see what you are getting in your converted mark-up
  • If you find something you don't want, use .replace() to substitute (or add) other HTML.  For example, you could add font size or color changes to the tags.
Like Hunter1428 likes this

Hi, @Bill Sheboy 

Turning off "Convert line breaks to HTML line breaks" worked great!

Problem is fully solved it seems. I tested it with some emails with different format styles and so far they all worked as expected. 

Thanks for the help!

Like Bill Sheboy likes this

I am glad to hear that helped!

Hi All,

Just wanted to share, that disabling the "Convert line breaks to HTML line breaks" also solved some problems I was having.

My issue was that the HTML Email was correct in terms of content and font/color - but there were huge blocks of br being inserted and spacing things down the page way too far.

Unticking this option and it looks exactly as expected when opened in the browser as an html file.

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