Retrieving selected Role details in forms

Requirement:
I have to create a form where it contains fields Application name, role name, role description,Owner,and entitlements.

While selecting on application role name field is a drop-down which shows all roles of the application. While selecting on it.

Role description,role Owner and that role entitlements has to be retrieved automatically.

I have developed a code to retrieve role description but I am not able to figure out how I can retrieve it’s owner and entitlements.

Hi @Chiru_1307

Welcome to the SailPoint Developer Community.
Please share your form and your current code here.

You mentioned that you are able to get the description so assuming you have got the Bundle object in the form. Getting owner from bundle object is straightforward as you can get it by doing bundleObj.getOwner().getName();

Getting entitlement from a role (bundle object) is going to be multi step process. You will need to first evaluate the role type.
For IT roles you will need to get entitlement profiles for the role using getProfiles() and on each Profile object use getConstraints() to get filters containing entitlement and filter conditions which can be parsed to get the list of entitlements included in role.

If role type is Business then you will need to get required IT roles included in the role by using getRequirements() method and run above evaluation on each IT role.