Customized Leaver Workflow not sending email

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 have attached my workflow.

Can anyone please provide your feedback?

leaver workflow_test.xml (12.6 KB)

Hi @shruthi_m,

have you set the email configuration on Global Configuration? and it works?

1 Like

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.

1 Like

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

Try to use this as a start step

<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>
2 Likes

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.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.