Retain SSO Source during a clone

Sabrina10
Kilo Guru

We have unique SSO record for each instance in the Identity Providers table.

After each clone, we need to update the sso_source field on each user record so that it is using the correct record for that instance.

I've tried using a clone cleanup script, with this line to get the right value, but I think this is getting the IDP sys_id from the source instance and not the target instance.

var id = gs.getProperty('glide.authenticate.sso.redirect.idp');

Is there a way for me to specifically indicate to retrieve the property from the target instance?   If not, is there a way to identify the target instance when writing a clone cleanup script?   I can always hard code the sys_ids in the script, but I need to be able to identify which instance is being cloned over.

4 REPLIES 4

Brad Tilton
ServiceNow Employee
ServiceNow Employee

You might look into data preservers:



Create a data preserver


Data Preservers retain the entire record, correct?     I only want a single field on the record retained.  


I don't think retaining a single field is possible. When you clone if you don't preserve the record, the entire record gets overwritten by the new record. It's not actually doing updates.



The only thing I can think would be to export the data before the clone, then reimport it into the user records.


What I'm trying to do is set a field on the user record via a Clone Cleanup Script on the Target instance, but I need to know how to determine which instance is the target instance?       Is that   possible?