Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21667

Organization members list is a random selection of actual members

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Major Major
    • github-api-plugin
    • None
    • Jenkins 1.533 Github-api 1.43 ubuntu Amazon EC/2

      The code at the bottom of the description when run in the jenkins script console returns 30 members of the 82 members in my organization. I have found no pattern to which members it returns. Some are public, some are private. All are in github groups but many others in those same groups are missing.

      I discovered this because while using the github pullrequest builder plugin some users would be whitelisted and have their PRs run and some would not even though my organization was whitelisted. This appears to be the reason.

      The jenkins github user we use is an organization owner so should be able to see all users, but as I said, the list returned is both public and private already.

      import org.kohsuke.github.*;

      serverAPIUrl = "https://api.github.com";
      accessToken = "blahblah";
      organisation = "myorg"

      gh = GitHub.connectUsingOAuth(serverAPIUrl, accessToken);
      org = gh.getOrganization(organisation)
      members = org.getMembers();
      members

            Unassigned Unassigned
            jjrussell John Russell
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: