This workaround aims to assist Jira Service Management (JSM) projects (can also work for JSW and JWM products), which involves utilizing the Automation for Jira (A4J) feature to share all public (customer-visible) comments made in a issue via email.
This design is particularly useful in scenarios where you want to generate reports, notifications, or emails that include only the comments visible to customers, thereby maintaining the privacy of internal discussions and ensuring that only relevant, public-facing information is shared outside of the internal team.
At the moment, there are certain limitations in how to achieved this feature, but it is possible to workaround it using HTLM with Handlebars syntax.
Handlebars syntax is very particular about how conditionals and blocks are opened and closed. So in order to only get the public comments we can use the conditional check syntax below:
{{^internal}}
By using the {{^internal}} conditional check, the template ensures that only public (customer-visible) comments are included in the output. Internal comments are skipped and not processed within the {{^internal}}...{{/internal}} block.
Therefore, the HTML code to send the comments in the normal order will be:
{{#issue.comments}}
{{^internal}}
From: {{author.displayName}}
Sent: {{created}}
{{body}}
<hr>
{{/internal}}
{{/issue.comments}}
To order the comments by the most recent, you'll need to add ".reverse" as shown below:
{{#issue.comments.reverse}}
{{^internal}}
From: {{author.displayName}}
Sent: {{created}}
{{body}}
<hr>
{{/internal}}
{{/issue.comments.reverse}}
Extra tip
To include an emoji in the email title or body sent from Jira automation, you should use the Unicode equivalent of the emoji instead of the colon-syntax (
:emoji:
) that is commonly used in markdown or platforms like Slack.The emoji for a speech bubble doesn't have a direct, universally recognized shortcode across all platforms, but you can use the Unicode character for it.
However, when inserting this into an email subject or any text content, you must use the actual emoji character, like 🗨️, instead of the Unicode string. Most modern email clients and web interfaces support emojis, but how you insert them will depend on the system you're using for the automation.
Here are some steps and tips on how to achieve this:
Direct Insertion:
If you're editing the automation rule or the email subject line directly in a web interface, you might be able to insert the emoji directly. On Windows, you can use the emoji keyboard by pressing "
Win + ."
(the Windows key and the period key at the same time) to bring up the emoji selection panel. On a Mac, you can use "Ctrl + Cmd + Space"
to bring up the emoji picker.Simply find the speech bubble emoji, 🗨️, and click or tap it to insert it into your text.
Copy and Paste:
If for some reason you're unable to use the emoji picker or if the interface where you're setting up the automation doesn't support it, you could go to a website that lists emojis, find the speech bubble emoji, and copy it. Then, paste it directly into your email title in the Jira automation configuration. A simple web search for "speech bubble emoji" should lead you to a site where you can copy it.
HTML Entities (If Applicable):
In some cases, you might be able to use HTML entities to include emojis or special characters. This would be more common in the body of an email rather than the subject. For the speech bubble emoji, if supported, you could use
💬
. Note, however, that this method is less likely to be supported in email subjects.
This workaround will work as I demonstrate in the screen recording below:
Bruno Altenhofen
Atlassian Engineer - The guy from Proforma(Jira Forms)
e-Core
Krakow - Poland
1 accepted answer
5 comments