hub4j / github-api

Java API for GitHub
https://github-api.kohsuke.org/
MIT License
1.12k stars 718 forks source link

How to get list users that are assigned to an organization role #1806

Closed ishepard closed 4 weeks ago

ishepard commented 4 months ago

According to GH docs (List users that are assigned to an organization role), it should be:

https://api.github.com/orgs/ORG/organization-roles/ROLE_ID/users

In GHOrganization, I see there is a function listMembersWithRole, but it doesn't work for this case. The endpoint seems different:

/orgs/{this.login}/members

and when I tried it in my organization where there are 2 Owners and 1 Member, the function returns all members.

Is there a way to get this info? Thanks!

ishepard commented 4 months ago

This might be something on my side actually, I see that even when using the GH API I don't get the roles. I'll investigate further

bitwiseman commented 4 weeks ago

@ishepard Closing for now. Comment and I'll reopen.