- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2018 11:36 PM
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.
Thanks in advanced.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 01:03 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 12:42 AM
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
https://community.servicenow.com/community?id=community_question&sys_id=8a274729db1cdbc01dcaf3231f961998
NOTE: Mark correct or helpful if it helps you.
Warm Regards,
Raj patel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 01:03 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 01:09 AM
Thanks Deepak Its working now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 02:21 AM
Glad that it helped you 🙂