How to get users of a role?

Which IIQ version are you inquiring about?

Version 8.3

Share all details related to your problem, including any error messages you may have received.

Hello,
I know how to get roles of a user using API :
/scim/v2/Users/XXXXXX?lookupByName=True&attributes=urn:ietf:params:scim:schemas:sailpoint:1.0:User:roles
How to get users of a role in the same way ? I’ve tried with
/scim/v2/Roles/XXXXXX?lookupByName=True&attributes=urn:ietf:params:scim:schemas:sailpoint:1.0:Role:users
there is no error but neither no role.
Thanks.
JC

I don’t think any ootb SCIM API is api is available to get role membership data . you have to write custom API .

have you tried this?

Thank you but it gives info about a user and its roles, not all the users with a role XXXXXX as I’m looking for.

Hi @JCM67 ,

I think you might have to create a custom endpoint with the below filter to get the desired result.

import sailpoint.object.Filter;
import sailpoint.object.Identity;
import sailpoint.object.QueryOptions;
import sailpoint.object.Bundle;
QueryOptions qo=new QueryOptions();

String roleName="Accounting Business Role";
Bundle bundle = context.getObjectByName(Bundle.class,roleName);
String roleId=bundle.getId();
System.out.println("Role id Fetched as"+roleId);
Filter filter=Filter.eq("assignedRoles.id", roleId);
qo.addFilter(filter);
List<Identity> identities=context.getObjects(Identity.class,qo);
System.out.println("Total users::"+identities.size());
for(int i=0;i<identities.size();i++)
{
	Identity id=identities.get(i);
	System.out.println("Identity Name::"+id.getName());
}
context.decache();

Hope this helps.

1 Like

Even in another language as powershell, I have no object Sailpoint to do these requests in my enterprise (I cannot import it), that’s why i’ve begin with simple url. It’s ok to get data about a user, about a role, about the roles of a user, so it is frustrating to have not the same request to get users of a role.
Of course, I cannot extract all the base.
If I’ve no other way, I’ll contact the Sailpoint’s team in my enterprise.
Thanks for all.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.