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

then it looks good.

my hands are tied with this limited visibility on your issue.

only debugging the BR can help in this case, to understand why values are not getting set where as it works fine from background script .

 

Do you have any data policy in place which might be restricting the updates on incident record, I remember you said its updating on few incident but not on all, worth checking if that thing is creating a mess around?

 

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

Reddymahesh
Tera Contributor

@Ankur7   Any inputs on this