The CreatorCon Call for Content is officially open! Get started here.

Schedule job to cancel RITM if approval is pending with Inactive approver

Geeta5
Giga Contributor

Hi All,

I have a requirement where I have to create a job which runs daily to check all such approvals which are pending with inactive approvers. Below condition should be checked:

1)Approval is in 'requested' state and is pending with Inactive user

2)This is the only approval triggered in the RITM. This should not be a part of group approval.

3)In case this is the only User approval triggered in the RITM, then this approval should be set as 'Cancelled' and the corresponding RITM also set as 'Closed Incomplete'. User should get a notification that request has been 'Closed incomplete' as approver is no longer in system, please raise new request.

Please help on this 

 

--

Thanks,

Geeta Dhami

15 REPLIES 15

var gr = new GlideRecord('sysapproval_approver');
    gr.addQuery('approver.active=false'); // Copy Query rom List View