Retrieve work note from RITM

priyanka1028
Tera Contributor

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.

11 REPLIES 11

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

How/where/etc are you thinking of doing this? Please describe a bit more context.

 

If its just a before business rule, and just the last work_note, you could just use:
current.work_notes

In a after/async business rule this would already not work. Then you might use:
current.work_notes.getJournalEntry(1)

 

If you want all entries:

current.work_notes.getJournalEntry(-1)

 

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Anubhav24
Mega Sage
Mega Sage

Hi @priyanka1028 ,

 

Check if var notes = gr.work_notes.getJournalEntry(1);  check if returns the time and date as well.

Other way is to retrieve the latest work notes and then get the sys_id of RITM and then use this sy_id to query journal table using the work notes and then retrieve the date and time, but this will be cumbersome because we need to check if RITM is closed or not at the same time.

 

Please mark helpful/correct if my response helped you.