Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2017 02:15 PM
Here is the rejection part of my scheduled job. I just run this early in the morning each day.
var gr = new GlideRecord('sysapproval_approver');
var querystring = "state=requested^sysapproval.sys_class_name=sc_req_item^sys_updated_onRELATIVELT@dayofweek@ago@14";
gr.addEncodedQuery(querystring);
gr.query();
while (gr.next()) {
gr.state = 'rejected';
gr.comments = "Automatically rejected after 16 or more days of inactivity";
gr.update();
}