Get ONLY last updated additional comments / worknotes in the Incident History
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 05:46 AM
Hi,
Can somebody share the code for how to get
Get ONLY last updated additional comments / worknotes in the Incident History?
If you could give code, your response is much appreciated.
TIA .
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 06:24 AM
Try with below script in background script.
var gr = new GlideRecord('incident');
gr.get('<sys_id_of_incident_containing_comments_and_worknotes>');
gs.print('Last/Latest Comment: ' + gr.comments.getJournalEntry(1) + ' Last/Latest WorkNote: ' + gr.work_notes.getJournalEntry(1));
gs.print('All Comments: ' + gr.comments.getJournalEntry(-1) + ' All WorkNotes : ' + gr.work_notes.getJournalEntry(-1));
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 07:03 AM
I want to write a business rule to apply for all . Can you please share the code ?