Need to send notification to requested for manager's manager if the requested for manager is inactiv

suuriya
Tera Contributor

HI,

 

I have a requirement; notification need to be sent to requested for manager's manager if requested for manager is inactive.

Initially i have created the entire setup to send the notification to requested For's manager but now i need to add the logic if requested for's manager is inactive then notification need to be triggered to requested for manager's manager.

 

In workflow i have created an event

suuriya_0-1713944978339.png

and the event triggers the notification and in notification who will receive section param 1 is checked.

Note: In above script var_manager_name is a variable is present in catalog it will pop the manager's name based on requested for user.

notification need to send to requested for manager's manager only when the requested for's manager is inactive.

how we can achieve this please help me with the script.

 

Thanks in advance

1 REPLY 1

Swamy Malluri
Tera Guru
Tera Guru

Hi @suuriya ,

 

Try below script in Parm 1

 

(function() {
// return the value to use for Parameter 1
if(current.variables.var_manager_name.active == false){
return current.variables.var_manager_name.sys_id;
}
else
return current.variables.var_manager_name.manager.sys_id
}());

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

Thank you