Using the update and delete method we can update & delete a single as well as multiple record.
Update list of record :
var gr = new GlideRecord('incident'); gr.addEncodedQuery('state=2^priority=5'); gr.query(); while(gr.next()){ gr.assignment_group ="0a52d3dcd7011200f2d224837e6103f2"; gr.update(); }
Update list of records with updateMultiple :
var gr = new GlideRecord('incident'); gr.addEncodedQuery('state=2^priority=5'); gr.query(); gr.assignment_group ="0a52d3dcd7011200f2d224837e6103f2"; gr.updateMultiple();
Delete records :
var gr = new GlideRecord('incident'); gr.addEncodedQuery('state=2^priority=5'); gr.query(); while(gr.next()){ gr.assignment_group ="0a52d3dcd7011200f2d224837e6103f2"; gr.deleteRecord(); }
No responses yet