Is it possible to delete activity log (additional comment/worknote) from incident Form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 12:42 PM
Is it possible to delete activity log (additional comment/worknote) from incident Form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 12:53 PM
It can be tricky because you have delete the entry in multiple places. Here is a guru article that may be able to help you.
https://www.servicenowguru.com/system-definition/remove-activity-log-journal-entries/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 12:55 PM
You will just need to delete the record(comment) from sys_history_line. But ACL is setup to allow nobody to delete. So you can do background script or change the ACL and own the change throughout upgrades.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 01:10 PM
Hello,
Goto App Navigator and type: sys_history_line_list.do and find the sys_id of the activity you need to delete.
Go to Background scripts and run the below script.
var gr = new GlideRecord('sys_history_line')
gr.addQuery('sys_id','Enter the sysid of the record which your want to delete '); //Search for it from the sys_history_line table
gr.query();
if(gr.next()){
gr.deleteRecord();
}
This should do the work.
Please make sure you test it on your test environment first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 01:23 PM
Why do you want to delete activity log ? These are not the best practice guide.