Delete Activity comment log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2017 08:34 PM
I Want to delete the activity log from an incident and i followed the below steps to delete, still i could able to see the activity in incident. Attached is the screen shot which i need to delete.
- Right-click on the record and select Copy URL to Clipboard to obtain the unique sys_id of the record.For example: https://<instance name>service-now.com/nav_to.do?uri=incident.do?sys_id=85befb1c4a34bb12013b216a9fd5fee8
- Copy the sys_id. In the URL example above, the sys_id is: 85befb1c4a34bb12013b216a9fd5fee8.
- Update the Journal Entry.
- Enter the journal entry URL + the sys_id. For example: https://<instance name>.service-now.com/sys_journal_field_list.do?sysparm_query=element_id=85befb1c4a34bb12013b216a9fd5fee8
- Locate the journal entry.
- Modify the record and update or delete the record.
- Update the Audit Entry.
- Enter the audit entry URL + the sys_id. For example: https://<instance name>.service-now.com/sys_audit_list.do?sysparm_query=documentkey=85befb1c4a34bb12013b216a9fd5fee8
- Locate the journal entry.
- Modify the record and update or delete the record.
- Rebuild the History Set. This is only required when you do not use direct auditing and the property glide.sys.activity_using_audit_direct is set to false.
- Locate all History Set records for the item whose history needs to be rebuilt by entering the history set URL + the sys_id. For example: https://<instance name>.service-now.com/sys_history_set_list.do?sysparm_query=id=85befb1c4a34bb12013b216a9fd5fee8<
- Click the Delete button for each History Set. This will delete the History Set, not the audit data. The History Set will be rebuilt with the corrected audit and journal information as soon as a user views the item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2017 09:00 PM
What is the use case of deleting the activity audit? There is an article on SN Guru which highlights how it can be done:
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
‎09-20-2017 02:14 PM
Hello,
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 will do the work.
Please make sure you test it on your test environment first.
Please mak the answer as correct / helpful to help others on community.
Thanks,
Ather
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2017 12:13 AM
iam not getting 'sys_history_line' table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2017 12:24 AM
It is a default global table. Are you able to search it within the Dictionary or navigate like https://<instance-name>.service-now.com/nav_to.do?uri=/sys_history_line_list.do.