- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2016 10:20 AM
I need this to happen only on an incident.
When I send out notifications for updates to the work notes, I need only the last one to show up.
I created an email notification script called "LastWorkNoteOnly":
(function runMailScript(current, template, email, email_action, event) {
// Add your code herevar ia = new GlideRecord('incident');
var ia = new GlideRecord('incident');
ia.query('sys_id', current.sys_id);
if ( ia.hasNext() && ia.next() )
template.print('Last action taken: ' + ia.comments.getJournalEntry(1));
})(current, template, email, email_action, event);
I then went to the notification itself and inserted the following code:
${work_note} was replaced with ${mail_script.LastWorkNoteOnly}
When I look at the notification in preview mode, it seems to work properly. However, when I run a test and get an actual notification, the work note area is blank and the last update is not there. In fact, if I change the getjournalentry to 4 (from 1) I still get nothing but preview will show the last 4 entries.
Preview:
What's sent:
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2016 10:23 AM
current.comments.getJournalEntry(1); //get last comment
Inserting just the last 'Additional comment' into e-mail notifications?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2016 10:23 AM
current.comments.getJournalEntry(1); //get last comment
Inserting just the last 'Additional comment' into e-mail notifications?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 02:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 11:47 AM
How are you wanting it to display? For us, we like having the newest work note appear at the top because this way we only really look at the most recent one.