Bulk load/import of standard change templates into new standard change catalog on Geneva?

timl
Kilo Contributor

Has anyone attempted or successfully completed a bulk load/import of standard changes templates into the standard change table?

I am looking to import just the standard change "Short Descriptions" to give our IT folks a starting place to use the system (we have almost 200 standard changes).   I plan on them going and updating the template for each one afterwards but since we have so many changes it would be nice if all of them did not all have to be loaded manually one by one by me or the IT teams.  

We are working with a vendor right now who is deploying our instance.   They were able to bulk load the templates into the table, [std_change_template], but now when a standard change template that was imported is clicked on in the catalog it takes you through the "Normal" workflow instead of "Standard".   They have opened a support ticket with ServiceNow but are saying that most likely they will all have to be added manually.

You would expect that since this is a completely new element added to Geneva that ServiceNow would have provided some way to import a companies existing standard changes.

Any guidance or suggestions would be appreciated!   Thanks!

14 REPLIES 14

Please disregard - I edited the transform map to add the missing field mapping.  And am using Load Data to import the spreadsheet, rather than the quick import option.


Susan Williams, Lexmark

Hi Jason,

I have been searching for the solution of moving the standard change templates & I have used the method which you have provided

It seems we get the data in std_change_proposal table, what if we want the data in std_change_record_producer table??

Will that be possible ??

andydoyle
Tera Contributor

We're facing a similar issue, but our organisation has already populated change templates, but only as system templates. Now we're enabling Standard Change and planning to convert our templates into standard changes with the script below (which others may find useful). Although we're creating catalog items directly. Now I'm not sure if we should be creating proposals.

// Convert old templates to new templates

// Set table to Templates
var gr = new GlideRecord('sys_template');
// Filter for basic templates 
gr.addEncodedQuery('sys_class_name=sys_template');
// Filter for change templates 
gr.addEncodedQuery('table=change_request');
// Run the query
gr.query();
// For each record...
while (gr._next()){
	// Convert old-style change templates to new-style templates
	gr.setValue('sys_class_name', 'std_change_template');
	// Save the record
	gr.update();
	// Get the name of the template
	tempname = gr.name;
	// Get the SysID of the template
	tempSysID = gr.getUniqueValue();
	// Get the description of the template
	tempdesc = gr.short_description;
	// Get the Assignmnet Group;
	tempgroup = gr.group;
	// Go the the catalog item table
	var gr1 = new GlideRecord('sc_cat_item');
	// Prepare a new empty record
	gr1.initialize(); 
	// Set the name of the new catalog item to the name of the template
	gr1.name = tempname; 
	// Set the description to the description of the template
	gr1.short_description = tempdesc;
	// Set active to true
	gr1.active = true;
	// Set the catalog to "Service Catalog"
	gr1.sc_catalogs = 'e0d08b13c3330100c8b837659bba8fb4'; 
	// Set the assignment group to the assignment group of the template
	group = tempgroup;
	// Set the category to Standard (routine) Changes
	gr1.category = 'b0fdfb01932002009ca87a75e57ffbe9';
	// Set type to item
	gr1.type = 'item';
	// Set class to Routine Change Template 
	gr1.sys_class_name = 'std_change_record_producer';
	// Link the catalog item to the template
	gr1.template = tempSysID;
	// Set availability to on desktop
	gr1.availability = 'on_desktop';
	// Insert the record
	gr1.insert();
}

gbunce
Kilo Expert

I used the above script to convert some current system templates to the standard change catalog. But when you try to use the new standard change template, the fields don't populate, like description and short description

Any idea why?

If I create one from scratch, the fields populate as expected.

andydoyle
Tera Contributor

Sorry, this worked on our Dev instance back then. We'll be lining up for a run in prod this year, and if I find that it needs changing, I'll re-post here.