Order of execution of the clone cleanup scripts?

Linda Kendrick
Kilo Guru

Anyone know what order the clone cleanups script are executed? We created a script and it has to run last.

I looked at System Clone - ServiceNow Wiki   and don't see any order.

  • Disable emails: Disables email on the target instance. A default data preserver maintains other email settings from the target instance.
  • Regenerate text indexes: Rebuilds text indexes on the target instance after a clone. Text indexes are not cloned from the source to the target instance.
  • Clear scheduled job node association: Resets any scheduled jobs that were active on the source instance to the Ready state. This script also clears the value of the System ID and Claimed by fields on all scheduled jobs.
  • Install deactivated plugin: Enables the Domain Separation plugin for instances that use this feature.
  • Drop backup tables: Schedules the deletion of the data contained in the target instance database prior to the clone. This original data is preserved for 24 hours following a clone to allow you to roll back an instance to the pre-clone state. If the target instance is downgraded as part of the clone, backup data is not available.
12 REPLIES 12

It looks like your enhancement went in with the Orlando release!

Nice!!!  Same for the "Active" field looks like.

how to run the script by writing this code

var actions = new GlideRecord("clone_cleanup_script");

 

actions.query();

 

while (actions.next()) {

 

  var name = actions.getValue("name");

 

  var script = actions.getValue("script");

 

//run the script //what would come here

 

}