How to delete worknotes or comments on Incident

Swapnil Meshram
Mega Guru

Sometimes ,we get security incidents and user wants to delete worknotes on the incidents.

so how we can delete   worknotes or comments on incidents.

1 ACCEPTED SOLUTION

Swapnil Meshram
Mega Guru

We used background script for deleting worknote in the incidents,below are scripts,



var gr = new GlideRecord('sys_history_line')


gr.addQuery('sys_id','Wrire down the sysid of record of worknote');


gr.query();


if(gr.next()){


gr.deleteRecord();


}


View solution in original post

4 REPLIES 4

Swapnil Meshram
Mega Guru

We used background script for deleting worknote in the incidents,below are scripts,



var gr = new GlideRecord('sys_history_line')


gr.addQuery('sys_id','Wrire down the sysid of record of worknote');


gr.query();


if(gr.next()){


gr.deleteRecord();


}


This has deleted only one set of record in history_line table. but when i impersonate other user the COMMENT is still visible. (not visible for me though) 

 

Followed below steps to Delete the Comment:-

* nav--> sys_history_line.list and filter for Worknotes records

* filter condition--> set is INC sys_id

* filter the worknotes record and delete

This will delete the Comment.