How To get Latest Comment On incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2021 01:22 AM
i want get latest comment on incident form. when incident state is In Progress and additional comment Changes.
Using Business rule GlideRecord.
1. Create Business Rule - On before update
state - In Progress.
And
Additional Comment Change
Script -:
var gr = new GlideRecord('sys_journal_field');
gr.addEncodedQuery('element=comments');
gr.addQuery('element_id', current.sys_id);
gr.addQuery('sys_created_by', '!=', current.caller_id);
gr.query();
if (gr.next()) {
current.setValue('description', gr.value);
}
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2021 05:12 AM
Thank you for marking my response as helpful.
If my response helped you please mark it correct to close the question so that it benefits future readers as well.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2021 10:22 PM
ive grabbed the latest comments or work_notes with with something like this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 06:18 AM
Hi,
On which table we have to apply this business rule ?