background script to change the assignment group of a closed incident (INC000234)

moneyplant
Kilo Contributor

Hi All,

Can anyone help me on this?

Thanks in Advance.

Sachin

1 REPLY 1

Prateek kumar
Mega Sage

var gr = new GlideRecord('incident');


gr.addQuery('number', 'INC000234');


gr.setLimit(1);


gr.query();


while(gr.next()){


gr.setWorkflow(false);


gr.setForceUpdate(true);


gr.autoSysFields(false);


gr.assignment_group = 'pass in sys_id of the   assignment group';


gr.update();


gs.info("Incident updated:" +gr.number);


}



Please mark my response as correct and helpful if it helped solved your question.
-Thanks