Remove User info and timestamp from commets

DS14
Tera Contributor

Hello All,

   Below regular expression is not working for me,it still showing the info and time in notification mail for Incident record. Is there any changes/property i need to modify for this.

find_real_file.png

  find_real_file.png

 

Thanks in advanced.

1 ACCEPTED SOLUTION

Deepak Ingale1
Mega Sage

Below is working expression I am using in returning work note and comments as output without time stamp and user details who updated it. It must work for you as well.

current.comments.getJournalEntry(1).match(/\n.*/gm).join("\n");

 

Note: Please mark reply as correct if it answers your question.

View solution in original post

10 REPLIES 10

Raj68
Mega Guru

Hi,

Your mail script would look something like this. Note, this is not a drop-in solution. You should understand what it does and make appropriate modifications for your table, field, and desired results.

 

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

 

var dateRE = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*\n/;

 

template.print(comment.replace(dateRE, ''));

                                                                                         or

Email Script

https://community.servicenow.com/community?id=community_question&sys_id=64e14ba9db98dbc01dcaf3231f96...

 

  https://community.servicenow.com/community?id=community_question&sys_id=8a274729db1cdbc01dcaf3231f961998

 

NOTE: Mark correct or helpful if it helps you.

 

Warm Regards,

Raj patel

 

Deepak Ingale1
Mega Sage

Below is working expression I am using in returning work note and comments as output without time stamp and user details who updated it. It must work for you as well.

current.comments.getJournalEntry(1).match(/\n.*/gm).join("\n");

 

Note: Please mark reply as correct if it answers your question.

Thanks Deepak Its working now.

Glad that it helped you 🙂