Which IIQ version are you inquiring about?
8.3
Share all details about your problem, including any error messages you may have received.
We have a scenario to send entitlements with the createAccount operation. Already enabled the createAccountWithEntReq flag.
<entry key="createAccountWithEntReq">
<value>
<Boolean>true</Boolean>
</value>
</entry>
ProvisioningPlan contains:
- FirstName —> String
- LastName —> String
- Group —> Managed and Single Valued
- Entitlements → Managed, Entitlement and MultiValued.
After executing the create account operation, it only takes Group attribute, and the Entitlements are passed to each Add Entitlement operation separately.
How can we combine all these attributes to a single create account operation?
Have you put the entitlement attribute in the body for create operation
“Entitlementattribute”: “$plan.Entitlement$”.
If you already have the body defined and still getting the issue. Write a before operation rule and put the entitlement attribute
String entitelementattribute="";
if(accountrequests!=null @and accountrequests.size()>0 ){
AccountRequest accountrequest = accountrequests.get(0);
log.debug("accountrequest "+accountrequest);
if(null!=accountrequest.getAttributeRequest("Entitlement")){
entitelementattribute = accountrequest.getAttributeRequest("Entitlement").getValue();
payload.put("entitlementname",entitlementname);
}
use this below code, if you are facing issue with writing a before operation, let me know I can write it.
Yes. I have added it in the body, but the plan itself does not have the entitlement attributes when checked the ProvisioningPlan in BeforeOps Rule, we only get the below attributes.
- FirstName —> String
- LastName —> String
- Group —> Managed and Single Valued
The entitlement attributes are passed to Add Entitlement Operation separately.
Please use the below operation rule for your entitlement attribute. Please replace entitlementattriute with your attribute and use this code. We are directly passing the entitlement attribute in the payload from this rule, as it is not able to pick. It will fix your issue.
Please mark the post as Solution, as it will help others
import org.json.JSONObject;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import sailpoint.object.ProvisioningPlan.AttributeRequest;
import sailpoint.object.ProvisioningPlan.AccountRequest;
import sailpoint.object.ProvisioningPlan;
import sailpoint.object.Attributes;
import sailpoint.object.Identity;
Map addRoleBodyMap = requestEndPoint.getBody();
String entitelementattribute ="";
String jsonBody = addRoleBodyMap.get("jsonBody");
log.debug("jsonBody from before rule : "+jsonBody);
if(null!=jsonBody){
JSONObject payload = new JSONObject(jsonBody);
log.debug("payload from before rule : "+payload);
List accountrequests = provisioningPlan.getAccountRequests(application.getName());
if(accountrequests!=null @and accountrequests.size()>0 ){
AccountRequest accountrequest = accountrequests.get(0);
log.debug("accountrequest "+accountrequest);
if(null!=accountrequest.getAttributeRequest("Entitlement")){
entitelementattribute = accountrequest.getAttributeRequest("Entitlement").getValue();
payload.put("entitelementattribute ",entitelementattribute );
}
String jsonBody = payload.toString();
addRoleBodyMap.put("jsonBody",payload.toString());
log.error("jsonBody "+jsonBody);
return requestEndPoint;
Hi @nihar_chaware, if your issue is resolved, by using the before operation rule. Can you please mark the post as solution as it will help others, if they are facing the same issue.