What is the use of getJournalEntry() method?

The Matrix
Tera Contributor

Hi all,

can anyone explain me what is the use of getJournalEntry() method?

2 REPLIES 2

Community Alums
Not applicable

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

 

Contact us: https://www.facebook.com/SNow-Knowledge-154868872024336/ OR Use Super Chat 1. How to get value of Journal Field in ServiceNow? 2. How to get value of comments & work notes in ServiceNow? 3. What is getJournalEntry()? 4. Demonstration with use case.

Deepika18
Tera Guru

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.