Automation rule xml content of {{comment.body}} get's filtered out in send mail

Jochen Betz
Contributor
November 14, 2024

When the body of a comment contains xml code, it is filtered out. when used in the "send email" action.

I've created an automation which sends an email notification whenever a comment is added to a ticket (reply to costumer). The email is supposed to contain the complete comment using smart value {{comment.body}}. But in case the comment contains a XML part like a part of a configuration file, it gets filtered out. The mail received does not contain the XML part.

I.e. if there is some text followed by a piece of xml code followed by some text, all text is there, but not the enclosed xml code.

The funny thing is, that the notification jira sends on it's own to the customer contains the complete comment (which is also shown correct in jira itself).

Trying to "escape" the body did not work neither.
* {{comment.body}} -> missing xml but containing the surrounding text
* .asPlainText -> completely empty
* .htmlEscape -> completely empty

* `{{comment.body}}` -> completely empty

 

 

1 answer

0 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 14, 2024

HI @Jochen Betz 

I just set up an automation on my side, that sends an email based on a comment.

I added XLM in a code block and as the code directly in the comment

The mail I received is populated with all information in the comment. 

I used Gmail address in this example.

So I think its an issue on the receiving mail server that is cleaning out information

Jochen Betz
Contributor
November 14, 2024

I'm not sure which server is used to send the mail though, but on the receiving side it doesn't matter.
When I'm the creator of a ticket I get the mail to my email address correctly.

In case I receive the mail via automation rule to the same address the xml content is missing. Thus I believe it's a problem on the sender side. As I don't assume it's using 2 different servers, I would locate the reason in the creation of the mail in the automation rule.

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 14, 2024

Hi @Jochen Betz 

Can you show an example of the comment content.

I used a code block and just a paste of xml code.

Jochen Betz
Contributor
November 17, 2024

No I can't as the limited editor capabilities are (of this forum) preventing me. Using "code" block doesn't help neither.

Quote:

There was invalid HTML in the message body that has been removed. If you're posting a link, add the hyperlink using the editor.

 

 

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 18, 2024

HI @Jochen Betz 

Raise it with Atlassian Support.

And explain your issue. I can't replicate the issue you are having

Jochen Betz
Contributor
November 18, 2024
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 19, 2024

Hi @Jochen Betz 

You are correct, but its not just Jira.

I have the same on other systems. And searching online also implicates that within an email body xml code is not shown.

 

Jochen Betz
Contributor
November 19, 2024

Thanks for confirmation @Marc - Devoteam 

But I have just copied the text into an email and send to myself and another account and it displays fine. Unfortunately I have to use MS Outlook which makes it really hard to show the source code of an email; and still I'm not sure if it shows me the correct thing. Because in the source I should see the xml no matter what the application renders it afterwards.
But as far as I can see, the content is not even there. And that's where it comes back to Jira. In this case it IS Jira messing up - at least half of it.

Because as I mentioned in my opening post, Jira IS capable of sending the data. It informs the user about a comment on the ticket automatically - and in this mail it works.
It does NOT work in the hand made automation to send the same data to another account.

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 19, 2024

Hi @Jochen Betz 

If I used the code from your image in a comment, only the text is displayed.

The code part is not in the email, there are blank lines in the email and on inspecting it see lines, but no values.

So correct the mail client shows nothing (I used Gmail).

I suggest to reach out to Atlassian Support, and see if they can see anything in the logging.

This is not visible from users/admins in these kind of cases.

Jochen Betz
Contributor
November 19, 2024

@Marc - Devoteam  Can you confirm, that the complete correct content is shown in the mail in case Jira itself notifies the customer who created that ticket?

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 19, 2024

Hi @Jochen Betz 

using your image, this information is displayed when adding a comment to the reporter of the issue.

In this email this is simply show, so it relates to the send email action in automation.

Jochen Betz
Contributor
November 19, 2024

Ok, it seems to me you did not understand what I mean with 2 different ways. Let me explain it again @Marc - Devoteam 

When writing a comment on the ticket using "reply to customer" 3 things happen automatically:

1. The comment is added in the ticket
2. The same comment is visible on the ticket visible to the reporter on the portal
3. Jira automatically informs the reporter that there is a new comment and includes this comment in the mail.

So far everything works. The automatic mail DOES contain the comment including the xml stuff.

Now, there is a manual automation which on new comment (doesn't matter if internal or external) is notifying the assignee about the new comment. The smart value {{comment.body}} used in automation does lead to a mail which contains the comment but does NOT contain the xml part.

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 19, 2024

HI @Jochen Betz 

  1. Comment added to JSM ticket, not using automation rules, the email contains XML
  2. Yes on both
  3. Also works.

If you use an automation rule, based on manual action or auto trigger an use the smart value {{comment.body}}, then it indeed fails to add the XML code.

 

Jochen Betz
Contributor
November 19, 2024

Thanks @Marc - Devoteam , now we are on the same page ;)

I'm not sure if there are other ways I could try. But all my initial attempts did not succeed


Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 19, 2024

Hi @Jochen Betz 

I think its simply related to the smart value {{comment.body}}, it doesn't matter how a rule is triggered.

In my opinion the issue lies with the smart value.

Jochen Betz
Contributor
November 19, 2024

yes, that's also my suspicion @Marc - Devoteam 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events