Getting error in provisioning plan

Which IIQ version are you inquiring about?

Version 8.3

Share all details related to your problem, including any error messages you may have received.

Hi Team,

I have one requirement I need to pas assigned role with two salesforce application attribute through plan and rest application attributes it will take from provisioning policy. Below is my code and error I am getting.

Error: Identity Attribute need to be present in the create provisioning policy of SalesForce User

code:

public ProvisioningPlan buildProvisioningPlanAttribute(HashMap userInputMap){
    Application app = context.getObjectByName(Application.class, userInputMap.get("Application"));
    String app1 = userInputMap.get("Application");
    String iden=userInputMap.get("UserID");
    Identity identity = context.getObjectByName(Identity.class,iden );
    System.out.println("BuildProvisioningPlanAttribute::!!!!"+"Application"+app1+":Identity"+iden+"::IdentityObject:"+identity);
    ProvisioningPlan plan = new ProvisioningPlan(); 
    String appType = null;
    String connType = null;
    String roleAppName = null;
    String srdTitle = null;
    String defaultRole = null;
    String defaultRole1 = null;
    List attreqList = new ArrayList();
    String action = userInputMap.get("ActionType");
    action = action.trim();
	  Bundle b = context.getObject(Bundle.class, userInputMap.get("RoleName"));
    //roleAppName = b.getAttribute("application_name");
   // srdTitle = b.getAttribute("SRDTITLE");
 
    Attributes att= new Attributes();
    AccountRequest accReq= new AccountRequest();
    accReq.setOperation(AccountRequest.Operation.Create);
    accReq.setApplication(app1);
   // accReq.setNativeIdentity(userInputMap.get("UserID"));
    att.put("comments","RequestId : "+ userInputMap.get("RequestId")+" | "+"RequesterName : "+ userInputMap.get("RequesterName")+" | "+ "ApproverName : "+ userInputMap.get("ApproverName"));
    AttributeRequest attReq= new AttributeRequest();
    attReq.setOp(ProvisioningPlan.Operation.Add);
    System.out.println("BuildProvisioningPlanAttribute::!!!!Calculte Attribute Request Started");
    			List list =(ArrayList) userInputMap.get("attributes");
    System.out.println("BuildProvisioningPlanAttribute:: All List::"+list);
        List accreqs = new ArrayList();
    			Map newlyMap = new HashMap();
    			if (list != null && !list.isEmpty()) { 
            System.out.println("BuildProvisioningPlanAttribute::List Szie"+list.size());
          for(int i=0;i < list.size();i++ ) {
            System.out.println("BuildProvisioningPlanAttribute::Inside For Loop");
        	   newlyMap = (Map) list.get(i);
        		 String attrKey = newlyMap.get("name");
        		 String attrValue = newlyMap.get("value"); 
          	 accReq.add(new AttributeRequest(attrKey, attrValue));
          	 System.out.println("BuildProvisioningPlanAttribute::Attribute Key::"+ attrKey+"Attribute Value" + attrValue);
            }

}
      attReq.setArguments(att);
      accReq.add(attReq);
      accreqs.add(accReq);
    //Role Request
    AccountRequest roleReq = new AccountRequest();
    System.out.println("BuildProvisioningPlanAttribute::Role Request::");
    roleReq.setApplication(app1);
   // roleReq.setNativeIdentity(userInputMap.get("UserID"));
    AttributeRequest roleAttrReq = new AttributeRequest("assignedRoles", userInputMap.get("RoleName"));
    roleAttrReq.setOperation(ProvisioningPlan.Operation.Add);
    roleReq.add(roleAttrReq);
    accreqs.add(roleReq);
    System.out.println("BuildProvisioningPlanAttribute::Role Attribute Append Completed");    
	plan.setIdentity(identity);
//	plan.setNativeIdentity(userInputMap.get("UserID"));
  plan.setAccountRequests(accreqs);
    System.out.println("BuildProvisioningPlanAttribute::END");

     return plan; 

 
   		
  }


Hi @amanKsingh
Are you adding this logic in Before Provisioning rule ?

Hi @amanKsingh ,

i had some difficult to understanding and I have some questions.

Can you print the final plan with plan.toXml()?
In which rule you call this funcion?

Basically, you can create a plan and execute; in this case you are creating a plan and return into another rule without execute the plan, so somenthing else need to perform this plan. I think you need one or more attribute for the execution.

@amanKsingh - You are not setting the native Identity for the account Request. Once you set that, things will start working.

accReq.setNativeIdentity(“Native Identitifier for the account”);

Mark it as solved, If it helps

Hi @all

we are calling LCM workflow from rule and here we are passing business role with two attribute in plan rest attributes it will take from privisioning policy.

Hi @amanKsingh ,

try to uncomment accReq.setNativeIdentity(userInputMap.get(“UserID”)), like @officialamitguptaa says.
But I am not sure the build of att value is correct, can you post the result plan?

Hi @enistri_devo,
Now I am able to see the business role and attributes in plan but inside business role I have IT role also which is containing entitlement but IT role is not going for provisioning. Can you please suggest how we pass IT role in Plan.

You can put in the plan the sigle attribute of the entitlement. Dont provising the Business Role, send the entitlement. Later, with during the refresh, SP detects and assign the Businnes and IT role.

@enistri_devo,
actually we have multiple entitlements so we need to pass role only. And we have customer requirement like that only we need to pass business role.,

so what you mean with IT role is not going for provisioning? is disable?

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