How to move updates from one update set to created update set

rameshrv999
Giga Contributor

Hi

I have updated the incident form but it captured in default update set I want to move the update from default to another update set

how can I move the updates from one update set to another

thanks in advance

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Venkata,



Here are the steps.


open the update set where you have captured all the changes.->Go to customer updates related list->Now open the customer update record that you want to update->Change the update set field to the update set you want and update the record.


You can do the same steps by selecting all records of customer updates(sys_update_xml) from list view and populate the update set to the one you want changes to be moved and UPDATE ALL. More info here on how you can update multiple records.


Editing Lists - ServiceNow Wiki


Screen Shot 2016-07-08 at 12.27.11 AM.png


View solution in original post

8 REPLIES 8

Hi Pradeep,

I am on the same boat, updated changes on default update set for service portal design changes and I followed these steps you provided but experiencing this error:

Error Message

Cannot move update to a set for a different scope

blaine2
Tera Contributor

A much, much more scalable solution that covers tons of use cases is the "Copy/Move to Update Set" UI Action.  This was recommended to us by ServiceNow Professional Services back in 2015 and our developers who prepare USes for promotion use it constantly.  I know that it's widely used by partners such as Accenture too.  You pick and choose Customer Updates from any Update Set listing and then copy or move the selected Customer Updates to wherever you want to.

Unfortunately we installed this so long ago that I can't find any references to the source and there's no clue in the object histories, so I've exported the 2 customer updates into the attached Update Set.  Go ahead and review the contents to see that it's very concise and has nothing undesirable.

Thanks Blaine - this is a much nicer solution, really appreciate you sharing this.

mikeb
Tera Contributor

Here's a script to do it, moves from one update set to another ( from https://blog.mikeski.net/servicenow/update-set-report-for-user/ )

var updateSet = new GlideRecord('sys_update_set');
updateSet.get('6d257828db0810102c071f83059619f9'); // User's new update set








var user = new GlideRecord('sys_user'); 
user.get('64ac802b1bc27b040e288480cd4bcb1c'); // User's record




// Copy all the update_xml records from Global udpate set to his new one.
var updateXml = new GlideRecord('sys_update_xml');
updateXml.addQuery('sys_created_by', user.getValue('user_name'));
updateXml.query();
while(updateXml.next()){
  if(updateXml.getValue('update_set') == '6ff0cd97db312200bd7cdbf0ce9619c1'){
  	gs.debug("Updatexml: " + updateXml.getValue("sys_id") + " " + updateXml.update_set.getDisplayValue() + " " + updateXml.getValue('update_set'));
    updateXml.setValue('update_set', updateSet.getValue('sys_id'));
    updateXml.update();
  }
}
updateXml;