- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2022 02:59 AM
We have a customer who would like to delete archive records (e.g. ar_incident). They have different requirements for deletion based on properties of the incident (e.g company, priority etc) however destroy rules seem very restrictive in terms of defining which records to delete at a given time, so these are not appropriate for this use case.
My initial thought was to use a script to delete thes records, but my attempt to use GlideRecord.deleteRecord() to acomplish this failed. No error given, but the record was not deleted either.
So my question is this: Is there any way to delete archive records other than by using destroy rules?
Many thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2022 10:15 AM
No, unfortunately you can only use condition builder
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2022 04:47 AM
You could try to flush those records using the Table Cleaner (Administration > Table Cleanup).
The cleaner runs in regular intervals and you need to set the "Age" parameter accordingly, to ensure only those records are considered, on top, you can add additional conditions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2022 04:52 AM
Hey,
A/C to SN support docs:
In order to ensure that all traces of an archived record are purged from the instance ServiceNow recommends the creation of a Table Cleaner (sys_auto_flush) or a custom script job to complete the required clean up based upon your specific requirements
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2022 07:31 AM
Thanks Aman,
This is what the customer has decided to implement. Is it possible to script this in any way?
Tom

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2022 10:15 AM
No, unfortunately you can only use condition builder
Aman Kumar