how to print multiple line information from comments in email notification by removing the updatedby

Rajavardhini
Tera Contributor

Hi Team,

 

I want to print in email notification the multiple line(line by line) information from comments as it is as shown in the below screenshot.But the output as shown in the email screenshot.

Rajavardhini_0-1720162204587.png

 

 

Rajavardhini_1-1720162289552.png

 

Email Script:

(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
    /* Optional EmailOutbound */
    email, /* Optional GlideRecord */ email_action,
    /* Optional GlideRecord */
    event) {

var lastComment = current.comments.getJournalEntry(1);
        var lastCommentLines = lastComment.split("\n");
        lastCommentLines.shift();
        var rejectNotes = lastCommentLines.join();
        //var lastComments=rejectNotes.
        var lastComments=rejectNotes.replace(/,/g , '');
        template.print("Comments"+": "+lastComments+"<br/>");
   
})(current, template, email, email_action, event);
 
Could you please check and help me
1 ACCEPTED SOLUTION

Yashsvi
Kilo Sage

Hi @Rajavardhini,

please check below link:

https://www.servicenow.com/community/itsm-forum/notification-content-issue/m-p/455491

Thank you, please make helpful if you accept the solution. 

View solution in original post

1 REPLY 1

Yashsvi
Kilo Sage

Hi @Rajavardhini,

please check below link:

https://www.servicenow.com/community/itsm-forum/notification-content-issue/m-p/455491

Thank you, please make helpful if you accept the solution.