Add *multiple* organization members to a team / Bulk add users to team #74479
Replies: 4 comments
-
|
Script is not working as expected - invalid API endpoint: "C:/Program Files/Git/orgs/xxx/teams/yyy/memberships/xxx". Your shell might be rewriting URL paths as filesystem paths. To avoid this, omit the leading slash from the endpoint argument |
Beta Was this translation helpful? Give feedback.
-
|
Should it be any use, here's how I just solved this using PowerShell & GitHub's CLI: |
Beta Was this translation helpful? Give feedback.
-
|
I don't have that many members but the single fact that I have to look for a member by username across the whole list of all GitHub users is cumbersome. Even if I type almost the full name of the member (for instance is member is named "hello17" and I type "hello") I will see a bunch of unrelated users, and the true organization member "hello" won't even appear at the top. There is no way to assign an organization member to a team from the People tab either (and on specific person profile you can only create a New team, not assign it to an existing one). So I support this your suggestion, however I would also suggest a visual interface, good for people who have several, but not too many people to add, and who don't have the exact list of full usernames prepared in a text file, but still a good idea of the name of each person to add. The visual interface could be: a vertical list of people in the organization (and only them!) with a checkbox each. Check the box to add person. Type in the name filter to filter only people whose username contains a certain string. Click Submit to confirm adding those people. As a bonus, if we could, from each person's profile (in the People tab) add them to one or multiple teams (the reverse assignment), it would be great. |
Beta Was this translation helpful? Give feedback.
-
|
This is a valid usability concern — the current UI flow for adding members to a team is indeed repetitive and inefficient when onboarding multiple users. At the moment, GitHub’s web interface only supports adding members one at a time. There is no built-in bulk-add option in the UI. Practical Workarounds
gh api You can loop this in a script: for user in user1 user2 user3 This is the cleanest automation approach.
Endpoint: PUT /orgs/{org}/teams/{team_slug}/memberships/{username} You can script this in Bash, PowerShell, or Python for bulk onboarding. Why the UI Works This Way Team membership changes are treated as permission changes. GitHub likely keeps the flow manual to reduce the risk of accidental privilege escalation. That said, a multi-select or comma-separated input field would significantly improve onboarding workflows. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Product Feedback
Body
Hi GitHub.com Organizations/UI team,
I face a common user pattern where I want to add several organization users to a team at once -- e.g. if I'm creating a new team, or onboarding multiple people. Currently the process is completely manual and requires at least 3-4 clicks per user ("Add a member", type their username, "Add", "Confirm", rinse & repeat. See https://docs.github.com/en/organizations/organizing-members-into-teams/adding-organization-members-to-a-team). This is not productive for teams of more than a few members!
Ideally the UI for would allow us to add multiple users to a team in the same modal box by using something like comma-separated usernames.
Currently the only workaround is to directly call the GitHub API, as explained in this blog post:
"GitHub: Script to Mass Add Users to a Team": https://josh-ops.com/posts/github-script-to-add-users-to-teams/
Thanks for your consideration!
Beta Was this translation helpful? Give feedback.
All reactions