On invoking Standard Change Template through run script, CR created is not getting set as "Standard" rather as "Normal"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â02-01-2022 01:52 PM
Hey there,
I tried creating a Standard Change Request by Creating a Run script in Workflow and invoking Standard Change template. The CR is getting created with the defined values of the Template, however the type is getting set as Normal rather than Standard. When I create a CR manually by clicking on the Template, it creates a CR with type as Standard. I tried setting the type as 'standard' while creating but seems to be not working as well. Any suggestion on how to get the CR as Standard through Run Script. PFA for reference.
TIA
- Labels:
-
Change Management
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â02-01-2022 02:13 PM
Hi,
I see you're applying the template AFTER you've stated what type of change_request you want to create.
Please verify that the template is not overwriting it and consider moving your chg.type line to AFTER the apply template.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â02-03-2022 07:20 AM
Nope, Still not working!
Thanks much!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â02-03-2022 07:42 AM
Hi,
Please share your script as of now.
Doesn't really help us to just reply with "Nope, Still not working!".
Please help us with more information, so we can help you.
Please mark reply as Helpful, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â02-03-2022 08:07 AM
Tried both the approaches. Here is the code snippet:
var gr=new GlideRecord('change_request');
gr.Initialize();
gr.applyTemplate('CR Standard Actions');
gr.type='standard';
gr.insert();
var gr=new GlideRecord('change_request');
gr.addQuery('sys_id','0e1f44fb97d141106c3bbbc3f153af87');
gr.query();
if(gr.next())
{
gr.type='standard';
gr.update();
}