- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2019 10:54 AM
I have a super bizarre request from our Security Team. If a user changes ROLES they want to send out Tasks to the New Managers to see if they should keep their current access or remove it. If the new Manager doesn't respond within 7 days they want it to be rejected. The approvals are sent from the TASK level. One Request could have possibly 15 approvals for the same manager on it. Can you think of anyway I could do this in the Approval Script? I thought of a Timer but I don't want the whole RITM to cancel since these could go out at different times. etc. You can see what I mean below - I just need to know how i can get each approval individually to reject if it is not approved within 7 days. If it's approved it by passes decomissioning their access.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2019 12:00 PM
here is the script you can use in your scheduled job:
var gr = new GlideRecord('sysapproval_approver');
gr.addEncodedQuery('state=requested^sysapproval.numberLIKEritm^sys_created_on<javascript:gs.beginningOfLast7Days()^sysapproval.ref_sc_req_item.cat_item=<sys id of your catalog item>');
gr.query();
while(gr.next()){
gr.state = 'cancelled';
gr.update();
}
//replace the highlighted sys id with your catalog item sys id.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2019 11:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2019 11:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2019 11:25 AM
I thought about that but how would I find just this 1 request and not cancel all other approvals out there. I am sending notifications out by Workflow Activity maybe on that too?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2019 11:28 AM