- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2018 11:10 PM
HI - no way to exclude form the clone, I think this is because you cannot exclude tables that are inherited from the Task table. I've been running a post-clone script to remove cases , tasks, any remaining attachments and metrics.
// clean out HR case and HR task tables
new GlideTableCleaner('hr_case', 1, 'sys_created_on').clean();
new GlideTableCleaner('hr_task', 1, 'sys_created_on').clean();
// delete any remaining attachments
var gratt = new GlideRecord("sys_attachment");
gratt.addQuery('table_name', 'IN', 'hr_case, hr_task');
gratt.query();
gratt.deleteMultiple();
// delete any metrics for HR cases or HR tasks
var grmtr = new GlideRecord("metric_instance");
grmtr.addEncodedQuery('definition.table=hr_case^ORdefinition.table=hr_task');
grmtr.query();