JavaScript query - send notifications to approvers on pending requests

AnetaR
Tera Contributor

Hi, I'm having trouble achieving the below requirement, I'd love to get your support.

 

I need to find approvals in state requested, 30 working days old and send notifications to approvers advising them that the request is being closed due to no approval. So if I have a list of approvals like the below, I'd need 3 emails - one email for each request but the recipients on the email would include all in the request.

 

Req1 - approval1

Req1 - approval2

Req2 - approval1

Req2 - approval2

Req3 - approval1

 

I was able to get the list of all approvals and update the request but struggling to capture all approvers as as soon as it finds the first approval it only send the email to this person and changes the second one to no longer required. I'm doing this on a scheduled job.

1 REPLY 1

J Siva
Tera Sage

Hi @AnetaR 
You need to capture the approver info before updating the RITM.
If possible, share your script.
Regards,
Siva