Which IIQ version are you inquiring about?
8.2
Hello Community,
I am using webservice connector add entitlement operation to provision user access (Assign user account with entitlement).
I need to send account attribute “userid” in json body this is going as null as userid is not part of provisioning plan.
I tried using $plan.userId$ in the body but no use , how can i send account attribute in the json using before provisioning plan in Add Entitlement Operation. Below is my code snippet
import org.json.JSONArray;
import org.json.JSONObject;
import sailpoint.connector.webservices.EndPoint;
import sailpoint.object.ProvisioningPlan;
import sailpoint.object.ProvisioningPlan.AccountRequest;
import sailpoint.object.ProvisioningPlan.AttributeRequest;
import java.util.Map;
Map body = requestEndPoint.getBody();
String jsonBody = (String) body.get("jsonBody");
JSONObject jsonObj = new JSONObject(jsonBody);
JSONObject modifiedJson = new JSONObject();
AccountRequest accReq = provisioningPlan.getAccountRequest("Application_Name");
log.error("Modify accReq: " +accReq);
if (accReq != null && jsonObj != null) {
JSONObject userReqMsg = jsonObj.get("userRequestMessage");
if (userReqMsg != null) {
userReqMsg.put("code", accReq.getAttributeRequest("code").getValue().toString());
userReqMsg.put("userId", accReq.getAttributeRequest("userId").getValue().toString());
modifiedJson.put("userRequestMessage", userReqMsg);
} else {
log.error("jsonObj.get(\"userRequestMessage\") is null");
}
}
requestEndPoint.getBody().put("jsonBody", modifiedJson);