Update worknotes with setWorkflow false
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 02:22 AM
How to update worknotes comments in the RITM activity, when we use setworkflow (false) through background script?
req.work_notes = 'closed your request with approval';
req.request_state = 'closed_complete';
req.setWorkflow(false);// will not trigger BR/Email notification
req.update();
- Labels:
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 02:30 AM - edited 10-17-2022 02:33 AM
when you use setWorkflow(false) the journal entry is not audited and hence it won't show in activity log
solution
1) insert record into sys_journal_field using GlideRecord for your record and verify if the work notes shows in activity log
Example script
var rec = new GlideRecord('sys_journal_field');
rec.initialize();
rec.name = req.getTableName();
rec.value = 'closed your request with approval';
rec.element = 'work_notes';
rec.element_id = req.sys_id;
rec.insert();
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 05:37 AM
@Ankur Bawiskar yes its inserting a record in sys journal table , but I couldn't see it get updated in the REQ record activity
element id is correct, but why its still not get updated ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 07:30 AM
If it's still not showing in activity log when you are inserting record using GlideRecord in sys_journal_field then I believe it's not possible to achieve this.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader