How to manually add a record in Update Set?

loteodor
Kilo Contributor

Hi,

I am developing a custom application and I am trasferring an Update Set from a Test istance to Production. Due to the team inexperience some customizations has been not recorded in the current Update Set.

Can I manually add an element (a table field, an entire table, a business rules, ecc.) to a particular Update Set? I would like to avoid to do an 'Update/Save' operation to every customization i lost during the development, in order to see a new record in the Update Set..

Thank you

Lorenzo

11 REPLIES 11

Thank you vipsood!
This code is very helpful, and I use it frequently. Posting a slightly modified version for adding multiple records.

//WARNING running with an empty encoded query will attempt to add all records on the table to the udpate set.

//1. Ensure you are in the correct update set.
var rec = new GlideRecord('');//2. set table of records to add
rec.addEncodedQuery("");//3. add encoded query
rec.query();
while (rec.next()) {
	var um = new GlideUpdateManager2();
	um.saveRecord(rec);
}

loteodor
Kilo Contributor

Hi Jason,



thank you, your script work very good in case I want to save records of a table. I am trying to save the structure of a table, with all the fields (label, datatype, column name, ecc). Is there a simple way to do it?


For this, you'll want to export those records to xml and them import them into the next instance.   Just right click and export to xml, then in the new instance you'll need to elevate your permissions to Security Admin.   Then you'll be able to right click from any list view (doesn't even need to be the corresponding table as the table name is included in the xml data), and choose Import XML.


can this done for webservice import sets and transform maps . How to include them in the update set to move to a new instance? Is xml the easier way to do?


marcguy
ServiceNow Employee
ServiceNow Employee

It can get tricky, because of all the related records, i.e. a transform map, has transform scripts as well as all of the field map records, however if you can identify them yes, they can be exported and imported (though transform scripts as an example are included in update sets anyway )