Sometimes certain records are not stored in update sets- anyone who has moved changes from a development environment to production will know things like groups and schedules are not saved to update sets!
There is a way to make this happen though, all you need is the sys_id of the record you would like to add to the update set and also security admin privileges to allow you to elevate.
Simply run the below in a background script to achieve this:
1 2 3 4 | var gr = new GlideRecord("incident"); // be sure to query the table the record exists on gr.get("hd6s52gdhs8d7fhrbwghstw6e52"); // add the record sys_id here var update = new GlideUpdateManager2(); update.saveRecord(gr); |
That’s it, now your record will be added to the update set!
#
This is great, but here is an extra tip:
If you are using a while(gr.next()) cycle to save several records into an update set, the “var update = new GlideUpdateManager2();” needs to be declared outside of the cycle, or it wont work.
#
Great advice Joao, always a pleasure to work with you :).
Dan