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
Bir sorunun, farklı bir çözümün veya eklemek istediğin bir notun var mı? Giriş yapmadan da yazabilirsin.