Remove requested entitlements on termination

Hi Dylan,

What you can do is create a new method in Service Standard Rule with the name removeStickyEntitlements and have the following added.

public void removeEntitlementsStickiness(Identity identity, AccountRequest accountRequest, String attribute)
{
log.debug("Enter removeEntitlementsStickiness: " + attribute);
if(accountRequest == null)
{
log.error(“RemoveEntitlements: Invalid Arguments: accountRequest is null”);
return;
}
if(attribute == null) {
log.error(“RemoveEntitlements: Invalid Arguments: attribute is null”);
return;
}
if(identity == null) {
log.error(“RemoveEntitlements: Invalid Arguments: Identity is null”);
return;
}

	Account account = getAccount(identity, accountRequest);
	AccountRequest.Operation op = accountRequest.getOperation();
	if(null != idn.getRawAccountAttribute(account, attribute) && op!=null)
	{

		List ents = asList(idn.getRawAccountAttribute(account, attribute));
		if(ents != null) 
		{
			for (String ent:ents)
			{
				AttributeRequest attrRequest= new 
                                    AttributeRequest(attribute, ProvisioningPlan.Operation.Remove,ent);
				attrRequest.put("assignment", true);									
				accountRequest.add(attrRequest);									

			}	

		}
	}
	log.debug("Exit removeEntitlementsStickiness");
}

Once done please configure a trigger like below

[

{

    "op": "add",

    "path": "/connectorAttributes/cloudServicesIDNSetup",

    "value": {

        "eventConfigurations": [

            {

                "eventActions": [

                    {

                        "Action": "RemoveEntitlementsStickiness",

                        "Attribute": "memberOf",

                        "Value": null

                    }

                ],

                "Identity Attribute Triggers": [

                    {

                        "Attribute": "cloudLifecycleState",

                        "Value": "inactive",

                        "Operation": "eq"

                    }

                ],

                "Operation": "Disable"

            }

        ]

    }

}

]

Let me know if you face any issues in the same

1 Like