Skip to content

Improve exported CSV for groupMembersExport GraphQL mutation

Problem to solve

We have a groupMembersExport GraphQL mutation that exports group members to a CSV:

mutation {
  groupMembersExport(input: { groupId: "gid://gitlab/Group/123" }) {
    message
    errors
  }
}

We need to improve the CSV in the following ways:

  • Add a Group or project name column to the right of the Path column. The value should be the name of the group/project, i.e. My Project. This should not be the full name of the group/project that includes the parent groups, it should just be the name of the group/project itself.

  • Change all timestamp columns (Access granted, Access expiration, and Last activity) to ISO format with the full date and time with timezone (UTC timezone).

  • Add a new Membership status column to the right of the Membership type column that shows whether the membership is pending or approved. Pending memberships are members invited by e-mail.

  • Remove (Custom role) from the role name for custom roles. Add a new Role type column to the right of the Role column that shows whether the role is default or custom.

  • Rename the Access expired column to Access expiration.

Discussion highlighted that adding the name of group or project to the export would be valuable for auditing.

Edited by Daniel Tian