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