So what this script doing is its removing entitlement for connected apps (IIQ apps) but not not bizz apps or delimited apps.. so problem is identity contains entitlement of both IIQ apps and delimited apps and if i trigger this script IIQ app entitlements are getting removed but not delimited apps.
Identity identity = context.getObjectByName(Identity.class, identityName);
List bundles = identity.getAssignedRoles();
ProvisioningPlan plan = new ProvisioningPlan();
AccountRequest accReq = new AccountRequest();
plan.setIdentity(identity);
accReq.setApplication(ProvisioningPlan.APP_IIQ);
accReq.setOperation(AccountRequest.Operation.Modify);
for(Bundle bundle : bundles) {
String bundleName = bundle.getName();
log.debug("Processing role/bundle: " + bundleName);
accReq.add(new AttributeRequest("assignedRoles", ProvisioningPlan.Operation.Remove, bundleName));
}
plan.add(accReq);
log.debug("Provisioning Plan prepared: " + plan.toXml());
Provisioner provisioner = new Provisioner(context);
provisioner.execute(plan);
i tried by removing this line.still no luck
accReq.setApplication(ProvisioningPlan.APP_IIQ);