How do I create a schedule for a Standard Change

rick-jones
Tera Contributor

I am creating scheduling jobs via System Definition > Scheduled Jobs > 'Auto generate something (a change, an incident, a ci etc) from a template' for normal changes, which works as planned.  This is so I can automate the creation of a change record from a template for the regular changes such as monthly patching.

However when i select a standard change template it is creating it as a normal change.  This is default OOB in Kingston, but I would of thought it should of created a standard change as I am selecting a standard change template.  There are no options within a standard change template to set the type as standard.  Any ideas on how I can get a standard change to be auto created via the scheduled jobs.

 

I've searched the forums but have not found the answer

6 REPLIES 6

Nickels
Tera Expert

I've experienced the same issue when trying to schedule a standard change. Did you ever find a solution or did you end up just recreating the standard change as a template with the type of Standard and scheduling the 2nd template?

I eventually found a solution, by selecting the conditional box and using this script

 

var change = new GlideRecord('change_request');
change.initialize();
change.type = 'standard';
change.requested_by = "System Administrator";
change.applyTemplate('INSERT TEMPLATE NAME');
change.insert();

 

hope it helps.  Specifying the change type is crucial part, we also added in a requested by as it was leaving it blank