I customized my leaver workflow to send an email notification if the terminated user is a member of any workgroup, but the workflow is not sending the email.
I think the problem is that you have no transition to Email to Wrp step from any other steps so with explicitTransactions set to true this step will never execute.
I have configured the transition from βEmail to Wrpβ to βBuild Provisioning planβ. And also I have applied the condition to check the user is in workgroup or not in βStartβ step. Itβs not working
<Step icon="Start" name="Start" posX="14" posY="125" resultVariable="isWrp">
<ConditionScript>
<Source>import sailpoint.object.Identity;
import sailpoint.api.ObjectUtil;
import java.util.Iterator;
// Get the specific user
Identity id = context.getObjectByName(Identity.class, identityName);
// Get the specific workgroup
Identity workgroup = context.getObjectByName(Identity.class, "Entitlement Owners_1");
if (workgroup.isWorkgroup()) { // Check if the workgroup is valid
// Get workgroup members
Iterator wrkGrpmembers = ObjectUtil.getWorkgroupMembers(context, workgroup, null);
while (wrkGrpmembers.hasNext()) {
Object[] object = (Object[]) wrkGrpmembers.next();
Identity member = (Identity) object[0];
// Check if the user is in this workgroup
if (member.getName().equals(id.getName())) {
return true; // Return true immediately if the user is found
}
}
}
// If the user is not found in the workgroup, return false
return false;
</Source>
</ConditionScript>
<Transition to="Email to Wrp" when="ref:isWrp"/>
<Transition to="Build Provisioning Plan" when="!ref:isWrp"/>
</Step>
It seems that the ConditionScript in the Start steps is returning a false value. Please add logs to capture and verify the value being returned by ConditionScript. Additionally, check the Request object on the debug page to see if there are any pending email objects present.