WebService Before Operation Rule, IdentityIQ

Hey guys,

I’m working on a SailPoint IdentityIQ customization and need help verifying my approach. My goal is to get the attributes of an identity from a provisioning plan and use them in an update operation, specifically mapping these attributes into the request body. Below is the code snippet that I am currently using, but it is not working.

import connector.common.JsonUtil;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import sailpoint.object.Identity;
import sailpoint.object.Link;
import sailpoint.object.Application;
import java.util.Iterator;
import sailpoint.object.QueryOptions;
import sailpoint.api.IdentityService;


List accountRequestsList = provisioningPlan.getAccountRequests();

  
 if (accountRequestsList != null @and !accountRequestsList.isEmpty()) {
   
   
   for (item : accountRequestsList) {
     
    log.error("xxx item : " + item); 
    log.error("xxx item operation: " + item.getOperation().toString()); 
    log.error("xxx item native: " + item.getNativeIdentity()); 
     
    List attrReqList = item.getAttributeRequests(); 
     
        if (attrReqList != null @and !attrReqList.isEmpty()) {
                //iterate through attribute request list
                
              for (AttributeRequest attr : attrReqList) {
                  
                  log.error("xxx attr.getValue() class: " + attr.getValue().getClass().getSimpleName());
                
                 if (attr.getValue().getClass().getSimpleName().contains("String")) {
                    
                    log.error("xxx value " + attr.getValue());
                  }

                  
              }

         }  
   }

   
}else {
        log.error("xxx empty request");
}

This post should be moved to IdentityIQ.

Since it is IIQ, you can have Before Provisioning Rule, add missing attributes to the plan, so that you can have all attributes in your body. You don’t need Web Service before operation Rule unless there are other requirements.

import connector.common.JsonUtil;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import sailpoint.object.Identity;
import sailpoint.object.Link;
import sailpoint.object.Application;
import java.util.Iterator;
import sailpoint.object.QueryOptions;
import sailpoint.api.IdentityService;


List accountRequestsList = plan.getAccountRequests();

Identity identity = plan.getIdentity();

  
 if (accountRequestsList != null @and !accountRequestsList.isEmpty()) {
   
	for (AccountRequest accReq : accountRequestsList) {
		
		List attributeRequests = accReq.getAttributeRequests();
		if ( attributeRequests != null ) {
			for ( AttributeRequest attReq : attributeRequests ) {
			
				log.error("AttributeRequest name::"+ attReq.getName());
				log.error("AttributeRequest Values::"+ attReq.getValue());
			}
		}
	}
		
}

Thanks
Krish

Hi

If you search this forum for key words, you should find results.

Example: Searching for “getValue” I found the following

Pass Non-Provisioned Attributes from Before Provision rule to Connector Rules - Content / Community Blog - SailPoint Developer Community

Then you can search for other key words, like ‘AccountRequest’ etc

I can use $plan.variable$ ?

Yes, this is how your body will look like

{
    "userName": "$plan.nativeIdentity$",
    "email": "$plan.email$",
    "givenName": "$plan.givenName$",
    "displayName": "$plan.displayName$",
    "familyName": "$plan.familyName$",
    "telephoneNumber": "$plan.telephoneNumber$",
}

Thanks
Krish

2 Likes

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