ServiceNow: use updateMultiple() to bulk update incident location field

 

gs.log ('script start', 'fixScr:bulkUpdateIncLocation''); var bUpdate=true; //bUpdate=false; var grIncs= new GlideRecord('incident'); grIncs.addNullQuery('location'); grIncs.addQuery('service_portfolio','76aea709db7a9300ba27aa484b96xxxx'); grIncs.addQuery('opened_by','83914c06dbd6101081fb49a2xxxxxxx');//--Dynatrace User grIncs.query(); gs.log('TOTAL: ' + grIncs.getRowCount(), 'fixScr:bulkUpdateIncLocation'); if (bUpdate){ grIncs.autoSysFields(false);//--leave last updated datetime stamp intact grIncs.setWorkflow(false);//--skip business rules grIncs.setValue('location', '533d13781b641154d4802f0a2xxxxxxx');//--Dynatrace grIncs.updateMultiple(); } gs.log ('script end', 'fixScr:bulkUpdateIncLocation'');

Comments

Popular posts from this blog

GlideRecord setValue

URL link in addInfoMessage