How to get the last comment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2019 02:00 AM
we are sending a notification when the RITM is complete. The body should have the last comment in the body without timestamp.
How can i achieve this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2019 02:03 AM
https://developer.servicenow.com/app.do#!/api_doc?v=london&id=SGE-getJournalEntry_N
oh without timestamp, it is sad that service now does not provide this feature without timestamps.
We removed the annoying part with regex.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2019 02:07 AM
Hi
You can try something like this :-
var worknotes = current.work_notes.getJournalEntry(1);
var onlyNotes = worknotes.split("(Work notes)\n");
var lastWorknote = onlyNotes [1];

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2019 02:12 AM
can try this
var wn1 = target.work_notes.getJournalEntry(1);
var wn2 = wn1.split("(Work notes)");
wn2.splice(0,1);
var work_notes = ' Work Notes: ' + wn2;
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2019 02:57 AM
tried this.. not working