
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2019 09:04 AM
Hi,
We have a number of standard change templates that we would like to schedule. However, when you navigate to System Definition/Scheduled Jobs and then select "Automatically generate something (a change, an incident, a ci, etc) from a template", and select a standard change template, the system always generates a normal change record.
I cannot see anywhere where you can add Type = Standard to the Template Definition, nor can I see any other field you could reference in a script to make Servicenow know that this should be a standard change.
Anyone know how we can generate a schedule using this method please
Thanks
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2019 07:31 AM
Instead of using Scheduled Job to trigger template, use Scheduled Job to trigger a script and use a script like this:
var change = new GlideRecord('change_request');
change.initialize();
change.type = 'standard';
change.applyTemplate('std_template_name_here');
change.insert();
https://developer.servicenow.com/app.do#!/api_doc?v=kingston&id=r_GlideRecord-applyTemplate_String

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2019 07:31 AM
Instead of using Scheduled Job to trigger template, use Scheduled Job to trigger a script and use a script like this:
var change = new GlideRecord('change_request');
change.initialize();
change.type = 'standard';
change.applyTemplate('std_template_name_here');
change.insert();
https://developer.servicenow.com/app.do#!/api_doc?v=kingston&id=r_GlideRecord-applyTemplate_String

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2019 03:51 AM
Thanks Michael