- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2020 03:29 AM
Hi ,
am using business rule to capture the current work note as below code ,But requirement is when work note updated than only have to capture the work note and send to 3rd party tool .please guide me
current.work_notes.getJournalEntry(1)
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2020 05:52 AM
You can have condition in BR
current.work_notes.changes()
To get the latest work notes value use this
current.work_notes.getJournalEntry(1)
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
12-06-2020 05:44 AM
Hi
Try this
var k = current.work_notes.getJournalEntry(1).match(/\n.*/gm).join("\n");
var grInc = new GlideRecord('sys_journal_field');
grInc.addQuery('element_id',current.sys_id); // Adding filter to find current incident
grInc.addQuery('element','work_notes'); // Adding filter to fetch only Worknotes
grInc.orderByDesc('sys_created_on');
grInc.setLimit(2);
grInc.query();
while(grInc.next() && grInc.value != k)
{
gs.info(grInc.value);
current.work_notes = 'test ' +grInc.value;
current.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2020 05:52 AM
You can have condition in BR
current.work_notes.changes()
To get the latest work notes value use this
current.work_notes.getJournalEntry(1)
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
12-06-2020 06:09 AM
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2020 06:17 AM
I gave you the same syntax in the first reply.