Apply Standard Template for Change Request through Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2022 07:56 AM
Hi All,
I'm trying to create Standard Change Request through Pre-Approved Template. I'm using below script in workflow to create one, but its creating "Normal" Change request all other fields like Implement Plan, Justifications, Assignment Group, etc. are copied with same content mentioned in template. Only difference is Type of the change its inserted as "Normal"
var gr=new GlideRecord('change_request');
gr.Initialize();
gr.applyTemplate('standard_rfc');
gr.type='standard';
gr.insert();
//This is creating Normal Change
Kindly help to find the script through which I can submit a standard change through script.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2022 08:00 AM
Hi,
Try this, add appropriate values for placeholders for sys_id and name
var chg = new GlideRecord('change_request');
chg.initialize();
chg.type = 'standard';
chg.std_change_producer_version = 'sys_id'; // Sys ID of the Standard Change Templates version
chg.applyTemplate('template_name');
chg.insert();
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2022 05:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2022 06:03 PM
I am facing the same problem. Did you get the solution for this?
A normal change is getting created. Though I am using a standard template and set the type to standard.
Thanks,
Bharath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2024 01:23 PM
Did anyone find the solution for this one?