I’m currently working on a Before Operation Rule for a Web Services remove entitlement operation. I need to pass the FirstName and LastName in the request body, but I’m having trouble retrieving these values from the $plan object.
I’ve tried using $plan.firstName$ and $plan.lastName$, but these are coming back as null. I’ve also attempted to create a Before Provisioning Rule to get the values from the Identity object using identity.getFirstName() and identity.getLastName(), but this approach isn’t working either.
Error: Attempt to resolve method: getFirstname() on undefined variable or class name
Additionally, I’ve tried accessing the attributes using
Error: Attempt to resolve method: getAttributes() on undefined variable or class name
Has anyone else encountered this issue? Can someone please provide guidance on how to retrieve the FirstName and LastName attributes in a Before Operation Rule for Web Services?
Any help or suggestions would be greatly appreciated.
Parent endPoint - First get the account details and map those in response mapping
Child endPoint - Get the values from Parent response and pass it to body.
Also to your point why you are not getting values using $paln.firstName$ etc.
you can only get the requested attribute from the plan.
For e.g. in this case you are trying to remove the entitlement, so you will only get which role is getting removed and the nativeIdentity in the plan not others.
For Create Operation you are getting all the required values from Create Profile and they are there in the provisioning plan.
We can get all the required attributes from sailpoint but for that first you need to set these attributes in plan using beforeProvisioning rule and then you can use those using beforeOperation rule.
As I mentioned first set these attributes in provisioning plan, then get those attributes and their values using provisioningPlan argument in your beforeOperation rule and set your request body accordingly.