Fix non-existent owners on ServiceNow change tickets


var changes = ["CHG0006417"];
new_owner = 'ib35';
new_owner_group = 'BSG HR and Payroll Systems';

for (i=0; i<changes.length; i++) {
    new_owner_sysid='blah';
    var og = new GlideRecord('sys_user_group');
    og.addQuery('name',new_owner_group);
    og.query();
    if (og.next()){
       new_owner_sysid=og.sys_id;
    }

    var gr = new GlideRecord('change_request');
    gr.addQuery('number',changes[i]);
    gr.query();
    if(gr.next()) {
        gs.print("owner = " + gr.assigned_to);
        gr.assigned_to = new_owner;
        gr.assignment_group = new_owner_sysid;
        gr.update();
    }
}