How to remove system updates (such as emails) from the activity stream in an Incident Record

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2022 08:56 AM
So I have a employee who forwarded an email to the Service Desk that created an Incident. The only problem was that PIP was contained within the email. So, that email was included in the activity stream
The technician assigned to the ticket gets an email that contains the info
The technician updating the ticket generates an email to the caller (employee) and the technician that it was update and it contains the original email (with PIP info)
Now, they want me to remove all those emails from the activity stream due to the PIP info
I have tried via the history but even though I get prompted everytime I "delete' the emails, they are still there when I return to the incident
So, are there any specific steps to do this action short of deleting the entire record?
Thanks
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2022 09:07 AM
Hi there!
Go to 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.
*Note:-Please make sure you test it on your dev/test environment first and this should be used only when required for some security purpose as it is not recommended as best practice.
Please mark this helpful and solution accepted if this resolves your issue.
Regards,
Palak

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2022 10:46 AM
Well it didn't work (exported the record from production and imported into dev instance)
So, I tried to delete the line from the History on the ticket itself, and that worked.
However, when I tried the same action in production, the line is not longer showing in the history, but it is still in the ticket!
I am attaching screen shots of before and after to demonstrate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2022 06:46 AM
Hi there!
As mentioned above, wanted to confirm that you tried to delete the history record using Background Script in DEV instance?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2022 08:47 AM
Hi
Just checking if your issue got resolved?
Regards,
Palak