Expose user email address to admins in group and project members API

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

Admins need ability to get group and project member email addresses easily via API.

Currently for example if you want to get project owner email addresses for a project you must:

  1. Find owners - overly complicated - feature request #230019, bug #219299 (closed)
    1. Pull project to see if it's a personal namespace project as indicated by owner being set GET /projects/:id https://docs.gitlab.com/ee/api/projects.html#get-single-project
    2. If not personal namespace project
      1. Pull project members GET /projects/:id/members/all https://docs.gitlab.com/ee/api/members.html
      2. Client side, filter list to only owners
  2. Get owner email addresses
    1. For each owner get email via GET /users https://docs.gitlab.com/ee/api/users.html#for-admins

Intended users

User experience goal

The admin should be able to easily get email addresses for members of group or project via API.

Proposal

Expose email in GET /groups/:id/members/* and GET /projects/:id/members/* endpoints https://docs.gitlab.com/ee/api/members.html

NOTE: This endpoint incorrectly shows that it returns an email already. It does not in most cases.

Further details

Permissions and Security

Documentation

Update examples at https://docs.gitlab.com/ee/api/members.html

Availability & Testing

What does success look like, and how can we measure that?

What is the type of buyer?

Is this a cross-stage feature?

Links / references

Edited by 🤖 GitLab Bot 🤖