Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Slug to GHTeam per v3 API: https://developer.github.com/v3/orgs/t… #281

Merged
merged 1 commit into from
Jun 3, 2016

Conversation

apemberton
Copy link
Contributor

https://developer.github.com/v3/orgs/teams/ has a slug property for teams. This property is similar to the login property for users and organizations - a URL path friendly tokenized string (as opposed to free text in the name field).

Slug is better suited for use in automated / scripting cases when dealing with the Team API.

Admittedly, I wrote a test but could not test as the project's test harness requires super powers which I do not possess.

@reviewbybees

@ghost
Copy link

ghost commented May 14, 2016

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

*/
public GHTeam getTeamBySlug(String slug) throws IOException {
for (GHTeam t : listTeams()) {
if(t.getSlug().equals(slug))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Irritating that the single-team API seems to require a numeric ID rather than the “slug”.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just opened a feature request with GitHub support to allow selecting teams via :slug key in addition to the :id key within the API.

Copy link

@samrocketman samrocketman May 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They accepted the enhancement for selecting teams via :slug but with the usual "we make no guarantees" line. So we may or may not see it as a feature of the API in the future.

@apemberton
Copy link
Contributor Author

So @jglick was that a +1?

@jglick
Copy link
Contributor

jglick commented May 16, 2016

Yeah 🐝 insofar as I understand it.

@aheritier
Copy link

🐝

@apemberton
Copy link
Contributor Author

Nudge. Merge please.

@apemberton
Copy link
Contributor Author

Bump.

@kohsuke kohsuke merged commit 204e639 into hub4j:master Jun 3, 2016
@apemberton
Copy link
Contributor Author

apemberton commented Jun 15, 2016

Nudging @kohsuke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants