Monday, November 17, 2025

Fetch Roles based on Container Role Name

SELECT

    br.name         AS it_or_business_role_name,

    br.type           AS it_or_business_role_type,

    it.name          AS org_role_name,

    it.type            AS org_type

FROM identityiq.spt_bundle_children c

JOIN identityiq.spt_bundle it ON it.id = c.child

JOIN identityiq.spt_bundle br ON br.id = c.bundle

WHERE 

it.name = 'Pedia - IT - DPA Role';

=================================================================

import java.util.ArrayList;

import java.util.List;

import sailpoint.api.SailPointContext;

import sailpoint.object.Bundle;

import sailpoint.object.Filter;

import sailpoint.object.QueryOptions;

import sailpoint.tools.GeneralException; 


private static List getRolesBasedOnContainer(String container) {

List aList = null;

QueryOptions qo = null;

try {

aList = new ArrayList();

qo = new QueryOptions();

qo.add(Filter.eq("inheritance.name", container));

List<Bundle> objects = context.getObjects(Bundle.class, qo);

for (Bundle bundle : objects) {

aList.add(bundle.getName());

}

} catch (GeneralException e) {

System.out.println("GeneralException : " + e.getMessage());

}

return aList;

}

String container = "Pedia - IT - DPA Role";

List bundles = getRolesBasedOnContainer(container);

No comments:

Post a Comment

Content Assist set up in Eclipse

# Open the Eclipse application # Navigate to Windows > click on Preferences # Navigate to Java and expand it # Navigate to Editor a...