Background Scripts to Close the Change Request from backend

PHOTO EMBED

Wed Jun 05 2024 12:45:35 GMT+0000 (Coordinated Universal Time)

Saved by @piyranja3

var gr = new GlideRecord('change_request');
gr.addQuery('state', '-1');
gr.addQuery('number', 'CHG0030780');
gr.query();
while(gr.next()) {
    gr.state=3;
    gr.close_code='successful';
    gr.close_notes='Closing this change manually due to known error';
    gr.setWorkflow(false);
    gr.autoSysFields(false);
    gr.update();
}
content_copyCOPY