Create a Standard Change from Inbound email actions

Ben42
Tera Contributor

Hello Experts,

 

I want to create a standard change request from inbound actions and I am using the script below. It does create a change request of standard type but does not apply template. It just creates an empty change request for type 'standard'.

Any help is appreciated!

 

Ben42_0-1671655054022.png

Thanks,

Ben.

 

1 ACCEPTED SOLUTION

SanjivMeher
Kilo Patron
Kilo Patron

Correct line 7 to GlideTemplate.get(<sys id of the template>).apply(current);

Or You can try something like this

var t = new GlideTemplate.get(<sys id of the template>);
t.apply(current);


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

2 REPLIES 2

Tony Chatfield1
Kilo Patron

Hi, the developer portal syntax for applying a template does not seem to match your use,
can you clarify where you sourced the syntax you are using?

GlideRecord | ServiceNow Developers

Based on your partial screenshot, perhaps try something like

 current.applyTemplate("yourTemplate");

SanjivMeher
Kilo Patron
Kilo Patron

Correct line 7 to GlideTemplate.get(<sys id of the template>).apply(current);

Or You can try something like this

var t = new GlideTemplate.get(<sys id of the template>);
t.apply(current);


Please mark this response as correct or helpful if it assisted you with your question.