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-03-2022 09:15 AM
Hi,
Have you confirmed that the sys_id of the template you are using is a standard change template?
If not, please use that.
I think the template is where the issue may be.
You can also test without using a template and see if you can create the change by just specifying the type, this will help narrow it down that it may be the template locking it in to normal.
Also, please consider adding this to your script as well:
gr.std_change_producer_version = 'sys_id'; // Sys ID of the Standard Change Templates version
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 10:08 AM
Hi,
I had been passing the sys_id of the template, still not working.
var chg = new GlideRecord('change_request');
chg.initialize();
chg.std_change_producer_version = current.variables.select_change_template.current_version;
var tempName = current.variables.select_change_template.getDisplayValue();
chg.applyTemplate(tempName);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â02-03-2022 11:02 AM
Hi,
Please check your values for that variable to ensure it's correct data.
I also gave a link to another post you can review. Where they're doing the same thing and it's working.
Something is must likely incorrect with your data, perhaps.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!