Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to get the last cloned date/time of the "current" instance via server-side script?

doctorjim
Tera Contributor

I am needing to retrieve the date/time that the last clone was performed on the current (target) instance via server-side script.  Is there some hidden System Property I can fetch with gs.getProperty() or by using some other means?  The date/time only needs to be approximate (+/- 12 hours).  Querying the Clone History table would be very easy on my Production instance except that I need to do this on a non-Production instance.

9 REPLIES 9

BALAJI40
Mega Sage

it will be available in clone history, form here you get by gliderecord on that table and make query as last updated



System Clone > Clone History


check this for viewing clone history concept in the link,


http://wiki.servicenow.com/index.php?title=System_Clone#Viewing_Clone_History


Thanks, however our clones are performed from backups and therefore do not include the recent clone details recorded in the Production instance.   I need to run the script on the target instance to determine when it was last cloned over.


Mwatkins
ServiceNow Employee
ServiceNow Employee

I looked for anything that is available out-of-the-box that could give you this information but couldn't find anything.



There's probably other ways to do this, but here is one way:


Create a Clone Cleanup Script that updates a custom Property you create with a date value.


Thanks Matthew.   I considered such an approach, and may have to resort to that.   But I'm trying to avoid such a solution.   I even considered querying an Audit table to retrieve the oldest record (assuming the table is excluded from the clone) but that is not terribly reliable.   Any other ideas are welcome!