Why can't I add a cleanup script to they system clone profile?

David Sloan
Giga Guru

I can create a cleanup script, but if I go to the Clone Profiles related list, it does not show any profiles in the slushbucket. If I go to the System Profile clone profile, it does not give me edit capabilities, and I have no UI actions available in the Cleanup Scripts related list to be able to add this script there.

8 REPLIES 8

Hi @David Sloan 

I only just came across this whilst searching another topic related to clones. If you refer to https://www.servicenow.com/docs/bundle/xanadu-platform-administration/page/administer/managing-data/... then you will find that there is this section: 

 

You can create, edit, and delete clone profiles from the Clone Profile view. The system profile is a read-only clone profile that you can't delete. It shows a predefined list of table exclusions, data preservers, and cleanup scripts. This list is based on the plugins that your instance contains.

Effectively, the 'System Profile' clone profile is there as an OOTB version and the read only nature is enforced by design to prevent you making any erroneous updates. What you will effectively need to do is to create a new Clone Profile and configure that to use any customisations such as additional exclusions, preserves or clean up scripts. Hope that helps, although I appreciate it might be 2 years too late it might help others who find this post. 

David Sloan
Giga Guru

It looks like the ACL in the screenshot is what is locking this down. Notice that the condition is profile.name!=System Profile. I would create a new clone profile, but I am guessing I would need to add the 139 exclusions, 90 preservers, and 10 cleanup scripts that are already on System Profile. I don't see any automated way to do this, so it may be a laborious process. (I'd probably do it with a background script that copies all of these records rather than manually selecting 139 exclusions, etc.) The other possibility would be to modify the ACLs, but I assume ServiceNow has a good reason for keeping us from doing this. (Although if it's just that I want to add a cleanup script, I don't see why they'd want to prevent that.) How would others handle this? Create a new clone profile and add all those m2m records?

chaffou
Tera Expert

I have the same problem. Any suggestion?

chaffou
Tera Expert

I did find the reason why. In the write ACL of the Clone Profile table, there is a condition that exclude the "System Profile" clone profile. If you remove that condition you will be able to add your "Cleanup script" to the "System Profile" clone profile.

chaffou_0-1694439084148.png