Web Service not Passing variable

Hi @cdavis132,

Can you provide the error logs which will help to troubleshoot the issue. Also please share expected request body for Create Operation.
Verify the current Create request body by enabling Webservice loggers or you can have a BeforeRule which will print the requestEndpoint.

System.out.println("requestEndPoint=\n"+requestEndPoint.toString());

Logs1.txt (7.9 MB)

Also here is the link to the expect rest call for the expected API results

Hi @cdavis132,

As per the Precision Lender Documentation, officerCodes are also mandatory attributes. This attribute should be generated via the provisioning policy, and it is empty. Provide the office code value and test again.

I did and it is still failing. One thing I did notice looking at the provisioning engine for that event, Its trying to pass firstname and lastname over twice.

I got to the point where its passing over the correct attributes but still showing failures

You can try adding the below BeforeRule for the Create Operation. When we updated addRemoveEntInSingleReq to true, Sailpoint started considering as arrays in the request body and started adding square brackets. So, I have tried to pass the string value to the body sing the Before Rule. Try it out and see if it is working.

import java.util.Map;

import com.google.gson.Gson;

import sailpoint.connector.webservices.EndPoint;
import sailpoint.object.ProvisioningPlan;
import sailpoint.object.ProvisioningPlan.AccountRequest;
import sailpoint.object.ProvisioningPlan.AttributeRequest;
import sailpoint.tools.Util;

if (provisioningPlan != null && Util.isNotNullOrEmpty(provisioningPlan.getNativeIdentity()) && provisioningPlan.getAccountRequests() != null
        && !provisioningPlan.getAccountRequests().isEmpty()) {
    AccountRequest accountRequest = provisioningPlan.getAccountRequests().get(0);
    AttributeRequest homeRegionRequest = accountRequest.getAttributeRequest("homeRegion_id");
    AttributeRequest securityProfileRequest = accountRequest.getAttributeRequest("securityProfile_id");
    if(homeRegionRequest != null && securityProfileRequest != null) {
        Gson gson = new Gson();
        Map jsonBodyMap = requestEndPoint.getBody();
        Map payload = gson.fromJson((String) jsonBodyMap.get("jsonBody"), Map.class);
        payload.put("homeRegion", (String)homeRegionRequest.getValue());
        payload.put("securityProfile", (String)securityProfileRequest.getValue());
        jsonBodyMap.put("jsonBody", gson.toJson(payload));
        requestEndPoint.setBody(jsonBodyMap);
    }
}
return requestEndPoint;

I received the following error from the script

sailpoint.tools.GeneralException: BeanShell script error: bsh.EvalError: Sourced file: inline evaluation of: import java.util.Map; import com.google.gson.Gson; import sailpoint.connec . . . '' : Attempt to resolve method: getNativeIdentity() on undefined variable or class name: provisioningPlan : at Line: 11 : in file: inline evaluation of: import java.util.Map; import com.google.gson.Gson; import sailpoint.connec . . . ‘’ : provisioningPlan .getNativeIdentity ( ) BSF info: Precision Lender Before Provisioning Rule at line: 0 column: columnNo

Hi @cdavis132,

You should be using WebServiceBeforeOperationRule in Create Endpoint, not Before Provisioning Rule.

I switched it to the before rule and now getting the following error Exception occurred while performing ‘Create’ operation on identity ‘null’: Error executing before operation rule for endpoint ‘create’: BeanShell script error: bsh.ParseException: Parse error at line 1, column 11. Encountered: . BSF info: PrecisionLender Rule at line: 0 column: columnNo

Hi @cdavis132 , This seems as a parse exception on line 1, can you verify .