Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Business Rule script to copy work notes to associated cases taking a long time to run on problem

ColinAngstadt1
Tera Contributor

Hello

 

The script works, but takes almost two minutes to run when you update work notes on the problem.

 

Its an insert/update BR triggering when work notes change

 

var rec = new GlideRecord("sn_customerservice_case");
rec.addQuery("problem_id", current.sys_id);
rec.addActiveQuery();
rec.query();
while (rec.next()) {

rec.work_notes =  current.work_notes.getJournalEntry(1); 
rec.update();
}






(current, previous);

 

 

Thanks!

0 REPLIES 0