Approve for more than 15 days then 3 reminder emails should trigger

nameisnani
Mega Sage

Hi Team , 

 

can anyone please help me here with this requirement .

 

The requirement is when any approval gets triggered for RITM and if approver doesn't approve for more than 15 days then 3 reminder emails should trigger to the approver and after than even if the approver doesn't approver then the RITM should get cancelled .

 

Please help me here with the steps . 

If possible please provide screenshots for better understanding .

 

Thanks In Advance 

7 REPLIES 7

Community Alums
Not applicable

Hi @nameisnani ,

I tried your problem in my PDI and it works for me please create a before BR and add table sysapproval_approver and add below code 

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	var currentDate = new GlideDateTime();
	var futureDate = new GlideDateTime();
	futureDate.addDays(15);
	if(currentDate == futureDate){
		for(i=0; i<=2; i++){
			gs.eventQueue('eventName', current, current.number, gs.getUser().getEmail());
		}
		
	}

})(current, previous);

 

Create the event from All<Events<Registry and add that event name in BR 

gs.eventQueue('eventName', current, current.number, gs.getUser().getEmail());
 
Create new Notification from All<Emails<Notifications
Run that Notification on event trigger and add your Subject and Body 
 
Please mark my answer correct and helpful if this works for you
Thanks and Regards 
Sarthak

Hi Sarthak,

 

I was just wondering what is i in your code? How does the loop work?

kente
Tera Guru

I would add it in the RITM flow. Maybe create a subflow so you can add it where needed

kente_0-1715844162933.png

 

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @nameisnani ,

 

It can be done for individual catalog and also for a collective catalogs.

 

if its single catalog then you need to edit the existing flow and and use wait for conditon and timer activity and roll back to notification reminder. and cancel if the rollback happens more than 3 time.

 

if your doing for all approvals then you can build a dedicated flow with same logic which check for pending approvals and sends notificaiton. (use the same logic mentioned above in flow too)


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect