Application Provisioning Policy Form Issue

Which IIQ version are you inquiring about?

8.5p1

Share all details about your problem, including any error messages you may have received.

I have created an update provisioning policy form for one of the applications, I have a few fields that i want to be hidden based on the entitlement that was requested from Access Request. I have tried using the Rule option in the Type settings → Hidden but that gives me below error, I have tried putting this in the value settings → Value Rule but it doesn’t actually hide the field, my understanding is that i need to set the dynamic as true to make sure the rule is executed and it hides the field, but as soon as i set dynamic to true, it gives me the same error as below.

Caused by: org.apache.bsf.BSFException: BeanShell script error: bsh.EvalError: Sourced file: inline evaluation of: import sailpoint.object.ProvisioningPlan.AttributeRequest; import sailpoint.tool . . . '' : Attempt to resolve method: toXml() on undefined variable or class name: accountRequest : at Line: 6 : in file: inline evaluation of: import sailpoint.object.ProvisioningPlan.AttributeRequest; import sailpoint.tool . . . '' : accountRequest .toXml ( )
BSF info: script at line: 0 column: columnNo

Below is the piece of code I’m using for hiding the field

import sailpoint.object.ProvisioningPlan.AttributeRequest;
import sailpoint.tools.Util;
import sailpoint.object.ManagedAttribute;
import sailpoint.object.Filter;

System.out.println("accountRequest in modify form --- "+accountRequest.toXml());

String returnValue = "";

for(AttributeRequest attReq : accountRequest.getAttributeRequests()){
	if("roles".equalsIgnoreCase(attReq.getName()) && attReq.getValue() != null){
		Filter searchFilter = Filter.and(Filter.eq("application.name", accountRequest.getApplication()), Filter.eq("value", attReq.getValue()));
		ManagedAttribute ma = context.getUniqueObject(ManagedAttribute.class, searchFilter);
		if(ma != null && ma.getAttribute("vf_ma_group_sub_type") != null){
			if("Standard".equalsIgnoreCase(ma.getAttribute("vf_ma_group_sub_type"))){
				returnValue = "true";
				field.setRequired(false);
				field.setHidden(true);
			}
		}
	}
}

System.out.println("returning from hidden value rule -- "+returnValue);
return returnValue;

Hi @AroraA3

The error is coming from this line:

accountRequest.toXml()

It means accountRequest is not available or is null in this context.

You can try the following:

  1. First, make sure you have the correct import for AccountRequest.
  2. Then, check whether accountRequest is properly initialized before calling toXml().
  3. Also, verify if the toXml() method is available for that object.
  4. If it is not available or still causing issues, remove the method call and try again.

Thanks.

The problem here is that accountRequest is an argument available in the Rule, it prints the value fine when i don’t set the field as dynamic, but as soon as it is set as dynamic it isn’t able to find the accountRequest..

Let me try the same thing in my system. I will get back to you soon.

I was able to get this working, it was logical issue for the condition not being satisfied.