Remove time stamp and user info from notification

Abinash
Kilo Contributor

Hi,

I want to remove the date & time stamp and user info from my email notification and only want the text message. I am doing it on comment field for RITM.

find_real_file.png

Kindly help me to fix this

Thanks in advance

1 ACCEPTED SOLUTION

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, ''));


View solution in original post

18 REPLIES 18

You can do something like this:



var work_notes = current.u_work_notes.getJournalEntry(1);


var pos = work_notes.indexOf("\n");


gr.work_notes = work_notes.substring(pos);;


I managed to solve it just by doing like this:



var comment = current.u_work_notes.getJournalEntry(1);
var dateRE = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*\n/;


gr.work_notes = comment.replace(dateRE, '');



But thanks anyway!


I was going to go with a regular expression first, but didn't want to overcomplicate it (especially if the user changes their date format). Glad you found a solution.


So this helped me get the last comment in an incident to populate in the closure note section.

 

Needed to modify it some, but the var pos and the substring was great.

 

I did end up adding .trim(); to the end of the 'current' line that I had to trim out the space that was left from stripping in the indexOf.

 

Thanks Chuck!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi Chuck Tomasi,

  As you mentioned above I understand but I need clarification to where to put this regular expression exactly like in email template or anywhere.

Thanks 

Susmitha