diff --git a/Core ServiceNow APIs/GlideRecord/Force tracked change to Update Set/README.md b/Core ServiceNow APIs/GlideRecord/Force tracked change to Update Set/README.md new file mode 100644 index 0000000000..cd10f4b5d4 --- /dev/null +++ b/Core ServiceNow APIs/GlideRecord/Force tracked change to Update Set/README.md @@ -0,0 +1,2 @@ +Add untracked record to update set as tracked change +Ensure that the update set is in tracking / active mode, and application scope matches the intended update while running the script diff --git a/Core ServiceNow APIs/GlideRecord/Force tracked change to Update Set/changeCommitUpdateSet.js b/Core ServiceNow APIs/GlideRecord/Force tracked change to Update Set/changeCommitUpdateSet.js new file mode 100644 index 0000000000..2c1920ad54 --- /dev/null +++ b/Core ServiceNow APIs/GlideRecord/Force tracked change to Update Set/changeCommitUpdateSet.js @@ -0,0 +1,6 @@ +// 1. Add record to update set, Query for the record - get sys id +var rec = new GlideRecord('x_sms_request'); +rec.get('4012cbc3830d1210887ced70deaad389'); +// 2. Push the record into the current update set +var um = new GlideUpdateManager2(); +um.saveRecord(rec);