Basic understanding of getJournalEntry(-1)

Tejaswini9
Tera Expert

Hello Guys,

can anyone explain me in simple terms why do we use getJournalEntry(-1).

Thanks,

Teju

10 REPLIES 10

I have honestly never tried on a record with a ton of entries but I have seen some emails that are quite long because its using -1.  There are no limits mentioned on the developer portal:

https://developer.servicenow.com/app.do#!/api_doc?v=newyork&id=SGE-getJournalEntry_N

 

If you wanted the last 3, getJournalEntry(3) should work.

I'll have to give it a shot and actually try I suppose.

While it doesn't say it won't work...it doesn't indicate that it would work either, haha. Doesn't really give an indication that you can specify other numbers outside of 1 and -1.

I'll try and see what I can come up with in a test here in a little while.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Allen, I actually just verified the parameter will indeed grab the number of journal entries specified.  There is a loop behind the scenes that runs based on the number specified.  So this should indeed work as you asked getJournalEntry(3) will get the latest 3 entries.

 

 

Oh niceeeeeee


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Vishwajeet Ghor
Tera Contributor

Is it possible to fetch journal entries without user value? e.g. <data> - <comment> instead of <data> - <user> - <comment> ?