GL04 new approval mode needs to be set

Hi,

We have new requirement to set up GL04 approval mode in entitlement catalog which corresponds to both Entitlement and application owner approval mode. Can you please share the code for application owner as we have already set for entitlement.

Regards
Amit

I would say check approval assignment rule.

Hi @ayadav_12,

Please find a sample code snippet for approval assignment rule. If you are facing some specific issue, then let us know.

<Rule language="beanshell" name="Example Approval Assignment Rule" 
      type="ApprovalAssignment">
      
  <Description>
     This example rule switches all of the owners to spadmin.  The idea 
     of this rule is to allow some customization of the approvals 
     so the ownership can be cacluated for cases where you might
     use and exteneded attribute or some other means outside our
     default mechanisms to derive the owner of the Approval.
     
     This rule is typically configured on the Approval Step
     in the LCM Provisioning Workflow or can be set on any
     steps based on the "Provisioning Approval" step 
     library.
     
     Since 6.2
  </Description>
  <Signature>
    <Inputs>
      <Argument name="log">
        <Description>
          The log object associated with the SailPointContext.
        </Description>
      </Argument>
      <Argument name="context">
        <Description>
          A sailpoint.api.SailPointContext object that can be used to query the database if necessary.
        </Description>
      </Argument>
      <Argument name="approvals">
        <Description>
          List of approvals generated by the approvalScheme, maybe null if there were no
          approvals enabled.
        </Description>
      </Argument>
      <Argument name="approvalSet">
        <Description>
          Representation of the cart, also found on the approvals generated by the 
          default schemes.
        </Description>
      </Argument>
    </Inputs>
    <Returns>
      <Argument name='newApprovals'>
        <Description>
          
        </Description>
      </Argument>
    </Returns>
  </Signature>
  <Source>
    import sailpoint.object.Workflow;
    import sailpoint.object.Workflow.Approval;

    List newApprovals = null;
    if ( approvals != null ) {
      newApprovals = new ArrayList();
      for ( Approval approval : approvals ) {
        if ( approval != null ) {
          if (approval.getChildren() != null) {
            //Update all children so they will get the same Owner/Description.
            //This happens when running parrallel within a scheme. We nest them in a container so they can run concurrently
            for (Approval app: approval.getChildren() ) {
              app.setOwner("spadmin");
              // update the approver/owner and the description of the approval
              app.setDescription("Approval Assignment Rule Generated " + identityName );
            }
          } else {
            approval.setOwner("spadmin");
            app.setDescription("Approval Assignment Rule Generated " + identityName );
          }
          newApprovals.add(approval);
        }
      }
    }
    return newApprovals;
  </Source>
</Rule>

Thanks

1 Like

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