Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #5105

Closed
Open
Created Sep 16, 2013 by Administrator@rootOwner

API to get user object from username

Created by: linkinpark342

Summary: Cannot get user by username, only by user_id Steps to reproduce: curl 'http://server/api/v3/users/someuser?private_token=token' Expected behavior: API returns information about user with username someuser Observed behavior: API just returns 404, since it's trying to look up the user with primary_key someuser. Possible fixes: Make it so that https://github.com/gitlabhq/gitlabhq/blob/master/lib/api/users.rb#L25 will check for a username if the input text is not possible to be an id. For example if i pass a non-numeric, it should look up by username instead

I don't know the data model intrinsically so maybe this is a bad idea, just wanted to make it as a suggestion. This makes it extremely difficult to create a new issue and assign it to a user, since you need the user_id of the user to assign it.

Assignee
Assign to
Time tracking