- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2017 08:08 AM
Hi - we've been asked to exclude all our HR module data (hr cases, tasks, attachments etc) from our sytem clones
I understand from the documentation that you cannot exclude a table inherited from the task table.
THe queston is whether anyone has found a way to only partially exclude data from the task table (i.e. where task type is HR task or HR case)?
I've just spent the whole day running a background script to delete the data after the clone, and I think this will become more of a time issue hte more data is intered ito our system.
Also, I added a simple exclude on the sys_attchments table which doesn't seem to have worked either..
Has anybody encountered or overcome anything like this?
Solved! Go to Solution.
- Labels:
-
Instance Configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2017 09:54 AM
Use the GlideTableCleaner API. It is optimized for speed and performance. For example, here's a piece of code that would delete any incident record created more than 1 second ago. The API also automatically detects and deletes related attachment records.
new GlideTableCleaner('incident', 1, 'sys_created_on').clean();
NOTE: Since this API is not documented it is not officially supported. Beware.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2017 06:43 AM
HI I tried this today and it deleted all the HR cases very quickly, but did not process any of the attachments, tasks, metrics etc. Some process then started re-creating a whole bunch of new blank cases - I suspect this might be a business rule or something like that. I logged out to kill the process, and because I'm pressed for time will have to clone again and delete the cases using deleteMultiple() because I don't have confidence in the data integrity of this delete.
I'll try to look into this again when I can - seems very promising and certainly runs very fast!
Thanks again
Adrian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2017 05:41 AM
Adrian,
Glad to see that you are using the Community to learn more.
The Customer Experience team is striving to ensure that customer queries posted from the HI Service Portal are answered in timely and accurate fashion.
If you feel your question has been resolved, please mark the appropriate reply in the thread as being the Correct Answer.
This enables other customers to learn from your thread.
Thank you in advance.
If you are viewing this from the community inbox you will not see the correct answer button. If so, please review How to Mark Answers Correct From Inbox View.
Regards,
Teena Singh
Customer Experience: UX Strategy and Customer Insights
teena.singh@servicenow.com
ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2017 06:41 AM
Hi Adrian,
Please refer the below link in section 7.3 on how to excludes tables from cloning:
System Clone - ServiceNow Wiki
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2017 06:53 AM
Hi - thanks for getting back to me - this option is very useful, but unfortunately does not work for tables that are extended from the "task" table - i.e. I can exclude all tasks but not selectively just HR cases and HR tasks. I'm going to try a script using the table cleaner as suggested by Matthew Watkins - will probably have to re-do my clone tomorrow anyway, so will report back!!
See
"The system cannot exclude tables that extend the Task table and are also flattened into it as part of the table per hierarchy extension model. Since these extended tables are actually part of the same physical database table, the system clones the data when it clones the Task table. You can exclude tables that extend the Task table under two conditions. Either the system stores the tables in their own physical tables as part of the table per class extension model, or you exclude the Task table itself."
Regards
Adrian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2018 10:14 PM
Hi - Are you able to find a way to exclude hr_case table from Clone