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

terrieb
Tera Guru

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

 

5 REPLIES 5

Palak Gupta
Tera Guru
Tera Guru

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

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.

 

Hi there!

As mentioned above, wanted to confirm that you tried to delete the history record using Background Script in DEV instance?

Hi @terrieb 

Just checking if your issue got resolved?

Regards,

Palak