How to add HTML paragraph when sending an email notification in Automation for Jira
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Jira administrators would like to trigger an email in html format with a paragraph when a customer creates or adds a comment through the Customer Portal.
Solution
In this page, we will show you an example on how to trigger an email to the Service Desk Customer (author) with the content from the comment with HTML tags including a paragraph.
Automation rule
Email received
HTML code used in 'Send email' content
1
<h4 style="background-color:rgb(89, 89, 89);"><span style="color:white">Servicedesk Response</span></h4><div style="background-color:rgb(229, 229, 229);">{{comment.body.html}}</div>
Notes:
For the paragraph, do not use the <p> element to add a paragraph. You need to use <div> block.
The way Automation sends an email, if <p> is included, the Send Email action needs to convert wiki markup to HTML and it will append an additional <p> to the request and the styling in the section of the “comment.body.html” will be lost.
Use {{comment.body.html}} smart value to capture the comment body in HTML format.
Make sure the send e-mail action configuration is set to "Send as: HTML"
Was this helpful?