- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 02:58 AM
Hello. - Hello.
I am looking for a way to get the latest content about the "work_notes" entry in the incident table. I am trying to write the source to a script include, but I would like to know if there are other methods.
For example, if the latest entry for "work_notes" is "Test 1 was executed", I would like to get "Test 1 was executed" as a value.
Thank you in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 03:05 AM
Hi @yui ozo
Please find the below thread which has the solution.
How can I get all list of work notes in incident? - ServiceNow Community
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
Thanks & Regards,
Anitha H V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 03:05 AM
Hi @yui ozo
Please find the below thread which has the solution.
How can I get all list of work notes in incident? - ServiceNow Community
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
Thanks & Regards,
Anitha H V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 03:18 AM
Hi Yui,
Worknote is a journel field, to get latest work note from any table you can use getJournalEntry(1) method on server script. In your case you need work_note from incidnet table please use below script.
Note if you use getJornalEntry(-1) this will get you all worknotes available for the record.
var grIncident = new GlideRecord('incident');
if(grIncident.get('<sys_id>')){
var workNotes = grIncident.work_notes.getJournalEntry(1);
}
If my response helped you, please mark this response correct by clicking on Accept as Solution and/or Helpful. It will help other who are looking for same query.
Regards,
Shaikha.