- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2018 01:13 AM
Hello!
How do I include the additional comments to a notification email containing only the contents and excluding the date/time stamp and submitter?
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2018 01:36 AM
You need to depend on mail script to get this done...
Mail Script:
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var work_notes = current.work_notes.getJournalEntry(1); //replace with element name
var regex= new RegExp('\n'); // searching for the first line break
var work_notes2=work_notes;
var i = work_notes.search(regex);
if (i>0)
{
work_notes2 = work_notes.substring(i+1, work_notes.length);
template.print(work_notes2);
}
})(current, template, email, email_action, event);
Calling mail script in notification:
${mail_script:script_name}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2018 01:27 AM
You are adding it using variable which contain date and submitter.
You can try to create some kind of stripped field in the table and put this field to notification template.
Another approach is to create notification email script which will strip data for you before putting to mail.
i.e. *this is only an example I found in my system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2018 01:36 AM
You need to depend on mail script to get this done...
Mail Script:
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var work_notes = current.work_notes.getJournalEntry(1); //replace with element name
var regex= new RegExp('\n'); // searching for the first line break
var work_notes2=work_notes;
var i = work_notes.search(regex);
if (i>0)
{
work_notes2 = work_notes.substring(i+1, work_notes.length);
template.print(work_notes2);
}
})(current, template, email, email_action, event);
Calling mail script in notification:
${mail_script:script_name}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2018 02:08 AM
This worked! Thank you for this.
Is there also a way to get the submitter of this additional comment?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2020 05:12 AM
Thank you all. This is what I've been looking for. I gotta let our lazy ITSM team knows about this...