- 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
04-27-2016 03:29 PM
I think you are doing it right, except that you want the value of 'cmt' not 'cmt' itself so I would suggest gs.eventQueue("incident.commented", current, gs.getUserID(), cmt.value);

- 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
04-29-2016 06:07 AM
Hello Steven
I've tried this....but same results. It displays the sys_id of the last entry, not the actual entry itself.
Any suggestions?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2016 06:35 AM
Strike that - got it to work. Thank you Steven!