- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2016 12:42 PM
Hello All
I know this is a common thing but I have tried everything I could find on the Wiki.
Requirement: per TABLE, as needed, limit comments in 'Update Notification' emails to only the most recent journal entry.
I could change the system setting as found here Using Journal Fields - ServiceNow Wiki
However, this is a Global setting and will apply to everything...we require a bit more flexibility.
I found a helpful suggestion that would modify the Incident Events business rule and modify for 'comments changes' to:
if (current.operation() != 'insert' && current.comments.changes()) {
var cmt = current.comments.getJournalEntry(1);
gs.eventQueue("incident.commented", current, gs.getUserID(), cmt);
}
....and added ${event.parm2} into the notification's template, as shown below.
Short description: ${short_description}
Click here to view: ${URI_REF}
<hr/>
Comments:
${event.parm2}
<hr/>
<div>${mail_script:cxs_EmailSearchResults}</div>
However the result is one entry in the notification for comments that looks like a sys_id. See attachment.
Not sure why I can't get this to work. Any suggestions or workarounds?
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2016 03:31 PM
I use a Notification Email Script.
Scripting for Email Notifications - ServiceNow Wiki
Create the email script, then call the email script from the body of the notification with the ${mail_script:getLastComment} where you want the last comment to be located.
Here is my simple one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2017 10:25 AM
The ServiceNow Wiki content is no longer supported. Updated information about this topic is located here: Scripting for Email Notifications
Visit http://docs.servicenow.com for the latest product documentation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2019 06:54 AM
I'm using this email script and getting the comments surrounded by [code] and [/code]. Anyone experience this with email scripts?