How can we access account request attributes in provisioning plan

<ProvisioningPlan nativeIdentity="901514792" targetIntegration="JANIS" trackingId="7594e48c3d5a4837b16d8c01a7590047">
  <AccountRequest application="JANIS" nativeIdentity="fernando_stanke@nomail.com" op="Modify">
    <Attributes>
      <Map>
        <entry key="comments" value="teste"/>
      </Map>
    </Attributes>
    <AttributeRequest name="profileId" op="Remove" value="646bc984825d7f880405ba93">
      <Attributes>
        <Map>
          <entry key="allowSimplification" value="true"/>
          <entry key="assignment" value="true"/>
          <entry key="preferRemoveOverRetain" value="true"/>
        </Map>
      </Attributes>
    </AttributeRequest>
  </AccountRequest>
  <Attributes>
    <Map>
      <entry key="identityRequestId" value="0000014290"/>
      <entry key="requester" value="901525699"/>
      <entry key="source" value="LCM"/>
    </Map>
  </Attributes>
</ProvisioningPlan>

Hi everyone

I want to access account request attribute comments into before provisioning plan can anyone please help me with it

@Chiru_1307 -

Use below snippet as Before Provisioning Plan -

import sailpoint.object.ProvisioningPlan;
import java.util.Map;
import java.util.HashMap;
import sailpoint.object.Attributes;
System.out.println(“Receiving the plan as :”+plan.toXml());
Attributes attr=plan.getAccountRequest(“Wintel Application”).getArguments();// Provide the application name
System.out.println(“Map data:”+attr);
System.out.println(“Comments:”+plan.getAccountRequest(“Wintel Application”).getArgument(“comments”));

Input Plan -

<ProvisioningPlan nativeIdentity="1c2c3d4c" targetIntegration="Wintel Application" trackingId="bad5d30189ac49f68695ca0bd93144f2">
  <AccountRequest application="Wintel Application" nativeIdentity="1c2c3d4c" op="Create">
    <Attributes>
      <Map>
        <entry key="comments" value="Test Business Justification"/>
        <entry key="flow" value="AccountsRequest"/>
        <entry key="interface" value="LCM"/>
        <entry key="operation" value="Create"/>
      </Map>
    </Attributes>
    <AttributeRequest name="userName" op="Set" value="Cindy.Little@demoexample.com"/>
    <AttributeRequest name="Inactive" op="Set" value="False"/>
    <AttributeRequest name="empID" op="Set" value="1c2c3d4c"/>
    <AttributeRequest name="Manager" op="Add" value="c0a838668c661054818c662db0cb00fe"/>
  </AccountRequest>
  <Attributes>
    <Map>
      <entry key="identityRequestId" value="0000000128"/>
      <entry key="requester" value="spadmin"/>
      <entry key="source" value="LCM"/>
    </Map>
  </Attributes>
  <Requesters>
    <Reference class="sailpoint.object.Identity" id="c0a838668c61120e818c6113437800eb" name="spadmin"/>
  </Requesters>
</ProvisioningPlan>

Output of Above before Provisioning Rule -

Mark it as solved if it helps

Hi @Chiru_1307 ,

Add the following code to the before provisioning rule to access the comments.

  import sailpoint.object.ProvisioningPlan;
  import sailpoint.object.ProvisioningPlan.AccountRequest;
  import java.util.List;
  import java.util.ArrayList;
  import org.apache.log4j.Logger;
 

  String appName = ""; //set the application name
  String comments;

  if(plan!=null){

    List accReqs = plan.getAccountRequests(appName);

    if(accReqs!=null &amp;&amp; !accReqs.isEmpty()){

      for(AccountRequest accReq : accReqs){

        if(accReq!=null){

          comments = accReq.getComments();

        }

      }


    }

  }

  System.out.println("Comments : " + comments);

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