You can use the template you created in code to automatically populate the fields with the help of the following code.
var rec1 = new GlideRecord("incident");
rec1.initialize();
// rec1.applyTemplate("inc_temp"); template ismi ile işlem
GlideTemplate.get('42894f2d938002104d1a3a4efaba1069').apply(rec1); //teplate sys_id ile işlem
rec1.insert();

Share your experience
Got a question, a different solution or a note to add?
Log in or join us to write a comment.
Log in ↗︎Sign up ↗︎