How can I find entitlement is present in any role or not

Hi All,

How can I find role name. If my entitlement is part of that role.

Hi @amanKsingh,

You can create a rule to retrieve only the roles that have entitlements. Please see the code example below.

        import sailpoint.object.Bundle;
        import java.util.List;
        import sailpoint.object.Profile;
        import sailpoint.object.Filter;
        List bundleList = new ArrayList();
        List profiles = context.getObjects(Profile.class);
        if (profiles != null) {
            for (Object profileObj : profiles) {
                Profile p = (Profile) profileObj;
                List constraints = p.getConstraints();
                List filterList = null;
                if (constraints != null) {
                    for (Object filter : constraints) {
                        filterList = new ArrayList();
                        if (filter instanceof sailpoint.object.Filter.LeafFilter) {
                            sailpoint.object.Filter.LeafFilter f = (sailpoint.object.Filter.LeafFilter) filter;
                            Object value = f.getValue();
                            if (value instanceof ArrayList) {
                                ArrayList entitlements = new ArrayList();
                                entitlements = (ArrayList) value;
                                for (Object obj : entitlements) {
                                	if(obj != null) {
                                        Bundle bun = p.getBundle();
										if(null != bun)
                                        bundleList.add(bun.getDisplayName());
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
		return bundleList;
1 Like

Check OOTB Reports and make use of Advanced Analytics.

Hi @MVKR7T, Can you please suggest me report name and what query I need to use from advance analytics.

@amanKsingh
Just go to Setup → Roles–> Role Search and do advanced search
Under that Add filters for Entitlement Value and Application you need, you can add any conditions , so that once you run the search you should be able to see the roles that you need

1 Like

Hi @amanKsingh

Go to Intelligence → Reports

Under report tab, Search with Roles By Entitlement Report

Cheers
Krish