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

Hi Chuck,



Thanks for correcting me 🙂


Abinash, how are you doing with this? Let me know if you're blocked somewhere.


Spot on!!!!! Thanks Chuck, It worked out perfectly ..


But i would like to know what this thing actually do:


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


and how user info also got removed with this code??


eagerly w8ng to noe..



Thanks


The dateRE line is a regular expression. See episodes 31 and 32 of TechNow for more information. TechNow Episode List



The line basically says look at the beginning of the text for 4 digits, a dash, 2 digits, a dash, 2 digits, a space, 2 digits, a colon, 2 digits, colon, 2 digits and a bunch of stuff after that followed by a new line.



Then the "replace" says 'If you see that, replace it with nothing'.



If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.



If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View.



Thank you