The CreatorCon Call for Content is officially open! Get started here.

Incident Comments Format Issue

dharanikumar
Giga Guru

Hi Team,

When i add the additional comments in the incident. Then a notification will be triggered to the Caller and Assigned To.

#1 Additional Comments will be looking something like below in the incident:

find_real_file.png

#2 But in the email it is looking like below and it is not carrying any spaces or paragraph breaks or it is not carrying over the line returns etc.. This is not a good user experience and its confusing for them.

We are just getting the latest comment and printing using the email scripts.

template.print(current.comments.getJournalEntry(1));

find_real_file.png

#3 But i need to show like #1 with the same format.

Please suggest how to achieve the above #3.

Thank you!!

Kumar

1 ACCEPTED SOLUTION

Nikhil Bahurup1
Tera Expert

Hi,

Did you try this?

try replacing the newlines with html <br> tag as below. This should indent the text properly as per your requirement.

template.print(current.comments.getJournalEntry(1).replace(/(?:\r\n|\r|\n)/g, '<br>'));

 

View solution in original post

8 REPLIES 8

Jaspal Singh
Mega Patron
Mega Patron

Hi Dharani,

 

In the mail script you use you need to follow link that replaces HTML Tags & then gets it appear the way it does on the field.

dharanikumar
Giga Guru

Hi Jaspal,

Tried with the below in code my mail script.

var suggComm = current.comments.getJournalEntry(1);

suggComm = suggComm.replace("[code]", "");

suggComm = suggComm.replace("[/code]", "");

suggComm = "<div><table cellpadding=\"0\" cellspacing=\"0\" style=\"table-layout:fixed\" width=\"100%\"><tbody><tr><td colspan=\"2\"><hr /></td></tr><tr style=\"\"><td class=\"tdwrap\"><strong>" + suggComm;

suggComm = suggComm.replace("(Journaled comments)", "</strong>");

suggComm = suggComm + "</span></span></p></td></tr></tbody></table></div>";

template.print("\n" + suggComm);

Comments in the incident:

find_real_file.png

 

Email Received:

find_real_file.png

Thank you!!
Kumar

Great to know it worked. Kindly close the thread by marking appropriate answer as correct so that it does not appear in unanswered list & helps future readers to find quick solution.

Hi Jaspal,

 

It didn't worked.

I want to print like below not in a paragragh.

find_real_file.png

 

Thank you,

Kumar