We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Fix script issue

keshav77
Tera Contributor

Hi All,

in Incident form we created script include that is pasting caller email to short description. now I want to write fix script to update all record to get email in short description.

 what fix script  do we need to write update short description with email

1 REPLY 1

Bert_c1
Kilo Patron

Try the following:

 

 

var inc = new GlideRecord('incident');
inc.addExtraField("caller_id.email");
inc.query();
while (inc.next()) {
	inc.short_description += '\n' + inc.caller_id.email;
	gs.info('New short descrition: ' + inc.short_description);
	inc.update();
}

 

which added the caller's email to the existing short description.