How to get the last comment

SNOW39
Tera Expert

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?

10 REPLIES 10

David Stutter
Tera Guru

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.

Omkar Mone
Mega Sage

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];

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;


Regards
Harish

tried this.. not working