How to Map variables of RITM Table to fields in INCIDENT in javascript

Priya1111
Tera Contributor

 

HI All,

Could you suggest javascript code to how to Map variables present in RITM  to fields in INCIDENT table.

 

Thanks

 

1 ACCEPTED SOLUTION

Hi,

script should work fine provided

1) the variable on RITM is correct and refers to cmn_department

2) you should insert() and not update

var rec = new GlideRecord('incident');
rec.initialize();
rec.department= current.variables.department;
rec.insert() ;

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

11 REPLIES 11

Hi,

script should work fine provided

1) the variable on RITM is correct and refers to cmn_department

2) you should insert() and not update

var rec = new GlideRecord('incident');
rec.initialize();
rec.department= current.variables.department;
rec.insert() ;

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

HI Ankur, 

Thanks Much It Worked!!

Regards