github-api icon indicating copy to clipboard operation
github-api copied to clipboard

Should support `parent` team objects

Open Callek opened this issue 2 years ago • 1 comments

In GHTeam objects, there should be support exposing the result of the parent return from /user/teams .

Ideally this would be another GHTeam object, and bonus points if getMyTeams() [1] supports fetching all parents as well (possibly with an arg for consumers to request that functionality).

A clear and concise description of what the bug is.

Expected behavior A clear and concise description of what you expected to happen.

.getMyTeams() returns an GHTeam objects with references to their parent team. Bonus: .getMyTeams(True) (or some such) gets not only my direct teams, but any parent teams I'm a part of.

[1] - https://github.com/hub4j/github-api/blob/4bba9680706785d6385ed69243f41a5f36757463/src/main/java/org/kohsuke/github/GitHub.java#L870

** Extra Context ** The lack of parent being exposed makes https://issues.jenkins.io/browse/JENKINS-63051 harder to solve.

Callek avatar Oct 06 '22 18:10 Callek

@Callek If you can implement a PR (even without tests) it would be helpful for understanding what it is that you're suggesting.

bitwiseman avatar Oct 08 '22 04:10 bitwiseman