How do i trigger a standard change template in a workflow run script

Marcus23
Kilo Contributor

Hi, 

I have Standard Change Template i would like to trigger in a run script on a workflow. 

I tried this first 

"

var rec1 = new GlideRecord("incident");

rec1.initialize();
rec1.applyTemplate("my_incident_template");

"
a solution from the playbook. But i didn't work.

So when googling I found this thred in the community

https://community.servicenow.com/community?id=community_question&sys_id=054e0beddb9cdbc01dcaf3231f96..."

In that thred that this template is a template out of a recordproducer and that why the playbook solution from activate a template didn't work.

So now i have been googling to mush, involving friends a colleags and reading the thread i linked, but getting nowhere.

So do we have any ServiceNow-Ninja, whitchdoctor, superskilled community member that can give this some thought and apply a solution that explains how it works and what to do?

Take care!

Marcus

6 REPLIES 6

As i guessed, it is not so simple (tried it before)... 

You get a blank change created... you allso need to include the version of the template i think somehow... 

 

The empty change is when i ran it as a background script...

The other one is when created out of the standard change catalogfind_real_file.png

 

It worked perfect for me, thanks.