how to delete/modify/edit Work Notes

jlackman
Kilo Explorer

I'm new to this system, so please bear with me for this simple question. I'm trying to figure out if I can DELETE/Modify/Edit "work notes" that I attach to a Ticket.

I've looked through the Wiki and online documentation and cannot find any way mentioned to do this.

Example; I add "work notes" to the WRONG ticket, so I want to go back and remove them.

JL

5 REPLIES 5

Mark Stanger
Giga Sage

You can do this as an admin. Check out this post from SNGuru.com

http://www.servicenowguru.com/system-definition/remove-activity-log-journal-entries/


puffysleaves
Tera Expert

Here's another community post that I generally follow: Edit activity log additional comments

 

 

 

 

 

Here's what it says:

 

by Tony Manino on Aug 9, 2014 9:29 PM

 

The text still shows in the activity history of the record because it is actually displaying history entries constructed from the sys_audittable. You need to remove the text from sys_journal_field first, where the current entry is actually kept. Then remove it from sys_audit, and finally remove the sys_history_set record. When the task record is displayed again, the history records will be rebuilt with the updated journal entries.

 

 

 

The procedure below will work. Practice on another instance before you do this in production, and exercise caution. You will need to use an admin account.

 

 

 

SEI is "sensitive electronic information," i.e. something you don't want exposed for everyone to see.

 

 

1 Obtain the sys_id of the record

  1. Open the record containing the insecure SEI.
  2. Right-click in the record header, and choose Copy sys_id.

2 Remove from sys_journal_field

  1. Use this URI to query the journal entries: https://your-instance.service-now.com/sys_journal_field_list.do?sysparm_query=element_id=sys_id
    • Replace sys_id with the sys_id of the record.
    • Replace your-instance with your instance name.

If there are a lot of records, you may want to refine the query, adding a "Value contains SEI" condition. Replace SEI with the text you seek.

 

  1. Edit the Value field of each record to remove the SEI.

3 Remove from sys_audit

  1. Use this URI to query the audit entries: https://your-instance.service-now.com/sys_audit_list.do?sysparm_query=documentkey=sys_id
    • Replace sys_id with the sys_id of the record.
    • Replace your-instance with your instance name.

It may be helpful to add conditions to the query for "Old value contains SEI" OR "New value contains SEI".

 

  1. Edit the text of the Old value and New value fields, removing the SEI.

4 Delete the sys_history_set record

  1. Query the sys_history_set table using this URI: https://your-instance.service-now.com/sys_history_set_list.do?sysparm_query=id=sys_id
    • Replace sys_id with the sys_id of the record.
    • Replace your-instance with your instance name.
  2. Delete the record that is returned.

Hi ,

 

first i deleted sys_history_set comment record, then deleted record 

sys_journal_field, and sys_audit respectively, but comment was not deleted from incident comment, plaese anyone help me how delete comment in incident record

Had the same issue, but i was able to do it through a small script.
First delete from sys_journal_field

Then delete from sys_audit_list

If you're able to, delete from sys_hystory_list
If the record is greyed for delete, then open the entry which contains the comment, Use the script to delete this record.

		var gr = new GlideRecord('sys_history_line');
		gr.addQuery('sys_id', 'SYS_ID_OF_RECORD');
		gr.query();
		
		while(gr.next()){
		        for(var key in gr){
		                gs.info("Key: " + key + " val: " + gr[key]);
		                
		        }
		        gs.info(gr.deleteRecord());
		}
		
		gs.info("END");



image.pngimage.png