0

var gr = new GlideRecord('incident');
gr.addQuery('active', 'true');
gr.query();
while(gr.next()){
gr.category = 'hardware';
gr.autoSysFields(false);
gr.update();
}

'autoSysFields' is used to disable the update of 'sys' fields (Updated, Created, etc.)
Working Code Asked question August 26, 2024