remove system generated comments from the notification

nameisnani
Mega Sage

Hi Team ,

 

When ever a new comment were added into the RITM , Then there will be notification is  trigger to the user . 

 

 

 

 

nameisnani_0-1707793434213.png

 

 

nameisnani_1-1707793434243.png

 

 

 

perview of the email

 

nameisnani_2-1707793434215.png

 

 

 

logs

 

nameisnani_3-1707793434254.png

 

For every one hour notification is triggering 

 

 

Notification 

nameisnani_4-1707793434225.png

 

 

nameisnani_5-1707793434323.png

 

 

 

The ' System generated comments ' we don't want send comments . Like this condition we want include here . 

 

can anyone please help me here . how to achieve this . 

 

Please provide screenshot , for better understanding .

 

NOTE :- We want restrict only system generated comments in the notifications.

 

Thanks in advance 

5 REPLIES 5

Sumanth16
Kilo Patron
Hi,

Create an email script as below and put it into your notification removing the existing ${current.comments} line:

(function runMailScript(current, template, email, email_action, event) {


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


notes = notes.replace('Additional Comments', ' ');



template.print('<pre>'+notes+'</pre>');


})(current, template, email, email_action, event);


If Helpful please mark as Helpful/Correct.

Thanks & Regards,
Sumanth Meda
 

Hi @Sumanth16 

 

could you please provide me the screenshots for better uderstanding .

Hi @nameisnani ,

 

Please create an Email Notification script and call it in email notification.


Please refer to below thread:

https://www.servicenow.com/community/developer-forum/how-to-call-email-script-to-notification/m-p/18...

Thanks

Hi @Sumanth16 

 

I am not able to understand , could you please provde the exact screenshot