Skip to content

Instantly share code, notes, and snippets.

@ChecksumFailed
Created December 3, 2021 20:11
Show Gist options
  • Save ChecksumFailed/24e2b82be1a404d126e9ce4b70d570d8 to your computer and use it in GitHub Desktop.
Save ChecksumFailed/24e2b82be1a404d126e9ce4b70d570d8 to your computer and use it in GitHub Desktop.
(function () {
function newGrObject(tbl, obj) {
var grRec = new GlideRecord(tbl);
new GlideRecordUtil().mergeToGR(obj, grRec);
grRec.insert();
}
var oldUiPolicy = 'f6e44e7bdbc005101ad90cd7f4961916';
var newUiPolicy = '05610f08db50c5101ad90cd7f4961937';
var tbl = 'catalog_ui_policy_action';
var tempObj = {};
var grPolicyAction = new GlideRecord(tbl);
grPolicyAction.addQuery('ui_policy', oldUiPolicy);
grPolicyAction.query();
while (grPolicyAction.next()) {
tempObj = {};
new GlideRecordUtil().populateFromGR(tempObj, grPolicyAction);
tempObj.ui_policy = newUiPolicy;
newGrObject(tbl, tempObj);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment