How to delete field change entry in Activities

Bala13
Kilo Guru

Hello,

I have changed one field , so the histry has been tracked in activities.

Is there a way to delete the activity in servicenow?

I can see there are some steps provided for deleting the journal entries. But this is not realetd to any worknotes/comments

This is a field entry changes from past to present.

Please suggest me.

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Lalitha,

Can you explain what is required?

Field entry changed?

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

sriram35
Kilo Guru

Hi, 

 

Goto Application Navigator and type: sys_history_line.list 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','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();
}

 

I don't know this the best practice or not, But it will work.

 

Hope this helps!

If you have any more questions, please let me know.

If I have answered your question, please mark my response as correct and helpful.

Thanks,

Sriram

Hi Lalitha,

 

Hope you are doing good.


If I have answered your question, please mark my response as correct and helpful. so that this thread can be closed and others can be benefited from this.

 

Thanks

Sriram

Hi Lalitha,

 

Hope you are doing good.

 
Let me know if that answered your question.

If so, please mark an appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

 

Thanks

Sriram