WebServicesBeforeOperationRule unable to obtain nativeIdentity

Can someone explain the method that should be used to obtain the id number of the requested account in this rule:

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import connector.common.JsonUtil;
import connector.common.Util;
import sailpoint.connector.webservices.EndPoint;
import sailpoint.connector.webservices.WebServicesClient;
import sailpoint.object.*;
import sailpoint.object.ProvisioningPlan.AccountRequest;
import sailpoint.object.ProvisioningPlan.AttributeRequest;

String logPrefix = "Rule Testing 9-18";
List acct = provisioningPlan.getAccountRequest();
String nativeId = acct.getNativeIdentity();
log.info(logPrefix + " Native Identity is " + nativeId);
String fullUrl = requestEndPoint.getFullUrl() + nativeId + "/convert_to_agent";
log.info(logPrefix +" Full URL is " + fullUrl);
  requestEndPoint.setFullUrl(fullUrl);
return requestEndPoint;

I am trying to add an the requested account’s ID number to the context URL. I know that specifying provisioningPlan.getNativeIdentity does not work - it returns the ID number from the authoritative source. I need the “ACCOUNTNAME” listed in the screenshot below. It has to be in the provisioning policy somewhere, but I am unable to parse for it using this latest iteration of the rule above. Any help would be appreciated!

Hi @mgawlowski ,
Good Day!

please check the below code hope it is helpful

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import connector.common.JsonUtil;
import connector.common.Util;
import sailpoint.connector.webservices.EndPoint;
import sailpoint.connector.webservices.WebServicesClient;
import sailpoint.object.*;
import sailpoint.object.ProvisioningPlan.AccountRequest;
import sailpoint.object.ProvisioningPlan.AttributeRequest;
String nativeId ="";
String logPrefix = "Rule Testing 9-18";
		if (provisioningPlan != null) {
		log.info("Rule -  plan is not null");
			for (AccountRequest accReq : Util.iterate(provisioningPlan.getAccountRequests())) {
			 nativeId = (String) accReq.getNativeIdentity();
		log.info(logPrefix + " Native Identity is " + nativeId);

		
		}}
		String fullUrl = requestEndPoint.getFullUrl() + nativeId + "/convert_to_agent";
log.info(logPrefix +" Full URL is " + fullUrl);
  requestEndPoint.setFullUrl(fullUrl);
return requestEndPoint;

Thank You

3 Likes

Mahesh,

Thank you, that worked perfectly.

Mike

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