The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Workflows auto approval

sushma9
Tera Contributor

F029B114-345F-4B9B-BA34-04F09EB748BB.jpeg

Once the request is submited and approval will get trigger , if the approver is on not approved for 2 days then i need to auto approve the request and it will trigger the next level approval once it is auto approved . 

2 REPLIES 2

Mohith Devatte
Tera Sage
Tera Sage

hello @sushma9 not sure if this would work but give it a try 

1)After your approval activity use a timer activity and keep it as 2 days in duration 

Screenshot 2022-11-18 at 00.33.49.png

2)Then add an if activity saying if still the approval is in requested state with advanced script like below 

// This script needs to set answer to 'yes' or 'no' to indicate the state of the activity.
//
// For example,
//
answer = ifScript();

function ifScript() {

	var gr = new GlideRecord('sysapproval_approver');
	gr.addQuery('sysapproval',current.sys_id);
	gr.addQuery('state','requested');
	gr.query();
	if(gr.next())
	{
		return 'yes';
	}
	return 'no';
}

Screenshot 2022-11-18 at 00.35.43.png

 

3)After that use a approval action activity which says mark task approved

Screenshot 2022-11-18 at 00.36.19.png

 

Again not sure if this works i just thought of an idea but yeah give it a try and let me know 

If it works please mark my answer correct 

Thanks

 

HiMohit ,

Its not working