Standard Change Templates not being applied on change request if created using Flow Designer

Zeba2
Tera Contributor

Hi Team,

I'm trying to create a standard change by applying standard change template using "Standard Change Template Version" field available on the change_request table, and this activity is being performed from flowdesigner. but for some reason change request is getting created but template is not being applied.kindly help into this.

Have tried to refer the articles: https://www.servicenow.com/community/it-service-management-articles/working-with-standard-changes-in...

But no luck.

4 REPLIES 4

grantdanielson
Tera Contributor

Hi Zeba,

 

I'm experiencing a similar issue right now. Did you ever find a solution?

Hi Grantdanielson,

This issue was fixed by using the below code:

var chgRec = new GlideRecord('change_request'); //Initialize your Change Record
chgRec.initialize();
var chgProd = new GlideRecord("std_change_producer_version");
chgProd.addQuery("std_change_producer.name", 'Test Build Change');
chgProd.orderByDesc("version"); //latest version of Change Template is fetched
chgProd.query();
if (chgProd.next()) {
chgProp = chgProd.std_change_proposal;
}

var chgPropGR = new GlideRecord("std_change_proposal");
chgPropGR.addQuery("sys_id", chgProp);
chgPropGR.query();
if (chgPropGR.next()) {
var template = chgPropGR.template_value.toString();

chgRec.applyEncodedQuery(chgPropGR.getValue('template_value')); //This is the Magical Statement of this Code
}

 

Thanks,

Zeba Niekhat

Hi, thanks for this! I did the same too. So instead of using the OOB action, I created a custom action wherein I apply my template.

have you created a case for ServiceNow support?
There are multiple challenges with flow designer and standard changes.