Retrieve work note from RITM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 01:17 AM
Hi Team ,
I have one requirement where I need to retrieve the work note comment when RITM is closed and the date and time when it is added on RITM work note.
Please help me by providing your answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 01:27 AM - edited 02-23-2024 01:28 AM
Can you please share an example?
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 01:38 AM
I want to write a background script where I want to retrieve the RITM closed complete comment from work note and date time of that comment.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 01:50 AM
Hi @priyanka1028 here is the background script
var wn;
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('sys_id','6eae90c43bc02300bfe04d72f3efc4d2');// pass ritm sysid
ritm.addQuery('state',3); // pass close complete value
ritm.query();
if(ritm.next())
{
wn = ritm.work_notes.getJournalEntry(1);// get last worknotes
}
gs.info(wn);
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 01:54 AM
I have tried your script but I am not getting any output
Please look at once on below screenshot