Records not getting updated in List View

Reddymahesh
Tera Contributor

Currently , I have worked on a development where if service owner or service owner group has been changed on mapped application service table, It needs to be automatically updated in all the related incidents.

Issue is like only few records were seen getting updated on table list view not all.

 

Thanks. Below is the code for the BR I have used

 

(function executeRule(current, previous /*null when async*/ ) {
 
    var gr = new GlideRecord('incident');
    gr.addQuery('cmdb_ci', current.sys_id);
    gr.query();
    while (gr.next()) {
        gr.u_service_owner = current.managed_by;
        gr.u_service_owner_group = current.u_service_owner_group;
gr.update();
    }
 
})(current, previous);
21 REPLIES 21

@sushantmalsure  Not able to use Business rule debugger to find out which Business rule is not getting executed because of set workflow (false)

no no, I am saying remove setWorkflow(false) and then turn on debugger to see which activity (may be BR) is restricting this update because your script to update looks good to work.

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

@sushantmalsure I have used debugger and could see below BR's getting executed along with this BR and I cannot see any BR related to Activity getting updated through one

Reddymahesh_0-1691089510540.png

 

 

@sushantmalsure How to make the History fields to re-audited again and get the activities field populated by the same as this is getting effected SetWorkflow(false) usage in the BR

havent you removed setWorkflow(false) ? remove it and the check all the BR execution using debugger to figure out what is restricting the update operation. Also make sure this new BR has to be after update BR

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure