This is an old revision of the document!
Background Scripts
Approve
var app = new GlideRecord('sysapproval_approver');
app.addQuery('state','requested');
//app.setLimit(30);
app.query();
while(app.next())
{
gs.print('Approval count in requested state '+app.getRowCount());
app.state='approved';
app.update();
}