Basic understanding of getJournalEntry(-1)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2020 11:33 AM
Hello Guys,
can anyone explain me in simple terms why do we use getJournalEntry(-1).
Thanks,
Teju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2020 12:14 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2020 12:30 PM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2020 12:56 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2020 01:28 PM
Oh niceeeeeee
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2024 09:33 AM
Is it possible to fetch journal entries without user value? e.g. <data> - <comment> instead of <data> - <user> - <comment> ?