Skip to main content
Question

Liquid filter to allow for inclusion of line breaks

  • November 8, 2024
  • 2 replies
  • 40 views

KVertrees
Apprentice

We have integrated our Freshservice environment to a partner’s Service Now environment, which is working very well - with one exception.  The formatting of the Service Now text is getting removed during the integration. 

Here’s an example message that’s coming from Service Now.  The \r\n line breaks are showing this across multiple lines in Service Now.

"Your issue (INC-1XXXX) has been deemed solved.  Please review the attached notes for more information: Good morning!\r\n\r\n I have added the XXXXX. This section of the XXXX.\r\n\r\nRegards\r\nXXXX "

The body of the POST Command includes the following line: 
  "Description": "{{ticket.description | sanitize_html}}"

I believe santize_html is removing the \r\n breaks from the description as it’s handled in the POST processing.  Is there a way to allow for these to be included, or to replace the \r\n with a <BR> character before it’s cleaned up by the sanitize_html command?

Have also seen a reference to try {{ticket.description | url_encode }} as an alternative.

Looking for some community guidance, as it seems like it would be a common, relatively straightforward solution.

Thanks in advance!  
Kevin



 

Did this topic help you find an answer to your question?

2 replies

RobCrossHM
Skilled Expert
Forum|alt.badge.img+8
  • Skilled Expert
  • 98 replies
  • November 28, 2024

@KVertrees You’ve posted in a FreshDesk group - you’ll have more joy in the FreshService group.


Kamakshi V
Community Manager
Forum|alt.badge.img+10
  • Community Manager
  • 278 replies
  • December 3, 2024

I have moved the topic to Freshservice !!!! 


Reply