What is the use of getJournalEntry() method?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 04:58 AM
Hi all,
can anyone explain me what is the use of getJournalEntry() method?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 05:27 AM
Hi @The Matrix ,
getJournalEntry() is used to get the vaue of Journal Field (Eg.Work Notes, Comments,..)
Refer to this Article , well explained with Examples: https://dev.to/jibarican/working-with-journalentry-fields-3lei
Also, Watch this video : https://www.youtube.com/watch?v=2GiG7b3bBQc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 05:27 AM
Hi Siddharam,
Basically, Work Notes and Comments are Journal Input type of field in ServiceNow.
To get or print the values from those fields we use getJournalEntry() method.
For Example : Given 1 in the method to copy the latest work notes.
Written a BR on Incident Task Table to copy the Work Notes from Incident to Incident Task.
var inc = new GlideRecord("incident");
inc.addQuery("incident", current.sys_id);
inc.query();
while(inc.next()){
current.work_notes = inc.work_notes.getJournalEntry(1); // to copy latest work notes
}
Please feel free to ask incase of any queries.
Please mark it as correct if it resolved your query.
Regards,
Deepika.