Rule to get a manager for Coupa based on the level by iterating till the manager’s level is 10 and should not escalate to level 15 (CEO/VP), it should be stopped to level 14.
what change we can do in here ?
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule name="GetCoupaManagerRuleUpdated" type="IdentityAttribute">
<Description>Rule to get a manager for Coupa based on the level by iterating till the manager's level is 10 or more</Description>
<Source><![CDATA[
import sailpoint.object.*;
Identity userIdentity = identity;
String noManagerSet = "";
String managerLevel = null;
String managerEmail = null;
for (int i = 1; i <= 10; ++i) {
if (userIdentity != null) {
Identity managerIdentity = userIdentity.getManager();
if(managerIdentity != null)
{
if (managerIdentity.getAttribute("level") != null)
{
managerLevel = (String) managerIdentity.getAttribute("level");
int managerLevelValue = Integer.parseInt(managerLevel);
if (managerLevelValue > 9){
if (managerIdentity.getAttribute("email") != null)
managerEmail = (String) managerIdentity.getAttribute("email");
break;
}
else
userIdentity = managerIdentity;
}
else
userIdentity = managerIdentity;
}
else
break;
}
else
break;
}
return managerEmail;
]]></Source>
</Rule>
Thank you @KRM7 really appreciate it.
before going ahead had questions
As this is a cloud rule how can i get this reviewed & deployed without ES,
is there a way to at least let me deploy a cloud rule by self using API in lower Env, if yes could you point out which endpoint.
can this also be handled by transforms, can a transform handles this operations send over across to coupa application and manage manager email escalation based on the logic defined ?
I don’t think any OOTB Transform can support your requirement, you can use Static Transform with Apache Velocity script, it is not that simple but doable.