How to get Template values in "sys_template" table

sinu2
Tera Expert

Hi All,

 

I want to set "Template" values to my "incident" field values 

Actually "Template" is not a reference field in "sys_template" table it is a type called "Template value"

Please find the below screen shot

find_real_file.png

 

Now all i need to set "Impact","urgency","short description" values in to my Incident fields . This actually i am wrting in inbound email action.. How can i achieve this. Kindly please suggest

var gr = new GlideRecord('sys_template');

if (gr.get('c20f98cddbbbab0022f5d404ca9619e2')) {

gs.print(gr.name);
gs.print(gr.table);
gs.print(gr.active);

var templatee = gr.template.toString();
gs.print(gr.templatee.short_description);

Var inc = new GlideRecord('incident');

inc.initialize();

inc.short_description = gr.templatee.short_description

}

1 ACCEPTED SOLUTION

rad2
Mega Sage

checkout this community thread - https://community.servicenow.com/community?id=community_question&sys_id=c2f73626dbbaab80656a5583ca96...

 

Try

var t = new GlideTemplate.get('template sysid');
t.apply(current);

 

 

View solution in original post

1 REPLY 1

rad2
Mega Sage

checkout this community thread - https://community.servicenow.com/community?id=community_question&sys_id=c2f73626dbbaab80656a5583ca96...

 

Try

var t = new GlideTemplate.get('template sysid');
t.apply(current);