How to skip second level approval for remove request

Which IIQ version are you inquiring about?

8.4

Hi,
We have a requirement to exclude second level approval for remove request. Can we achieve this via approval assignment rule(it is already in place). Can anyone suggest a sample code for the same.
Thanks!

Hello Preethi,

I recently implemented this use-case. Try using below snippet as you already have approval assignment rule.

  Approval childApproval;

    boolean isNotRequired = false;
    String approvalDesc = childApproval.getDescription();
    if (approvalItem.getOperation().equals("Remove") @and approvalDesc.startsWith("Owner Approval")) {
      isNotRequired = true; // Skip approval item and return true to indicate it's not required
    }
//End