Auto close standard change/incidents after 5 days

The following script can be schedule to auto close the standard changes/incidents after 5 days to auto close var changeGR = new GlideRecord(‘change_request’); changeGR.addQuery(‘type’, ‘Standard’); changeGR.addQuery(‘state’, 0); changeGR.query(); while(changeGR.next()) { var dif = gs.calDateDiff(changeGR.sys_updated_on, gs.nowDateTime(), true); gs.print(changeGR.number); if(dif >= 5*86400){          changeGR.state = 3;          changeGR.comments = ‘Change Request […]