How to delete Work notes in ritm through script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 07:54 PM
I need to be delete the work notes on multiple RITM's. I am planning to use fix scripts , Can anyone provide solution to this.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 08:40 PM
Attach the below post for your reference.
How to remove undesired/unwanted comments from case record?
You can replace the query field name (element) from comments to work_notes. It should work as well.
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 08:43 PM
Hello @sasikalathota98
You can use this fix script
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();
}
Please check and Mark Correct and Helpful if it really helps you.
Regards,
Prashant Ahire
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 08:56 PM
so what did you start with and where are you stuck?
on what parameter(older than 90 days etc) you would like to delete work notes in those RITMs?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader