9

I'd like to have a individually callable url to see issues in gitlab for a specific user.

How can I retrieve the currently logged in user?

https://server/folder/project/issues?scope=all&state=opened&assignee_id=<how to get this id>

or

https://server/folder/project/issues?scope=all&state=opened&assignee_username=<how to get this name>

Edit:

Solved with scope=assigned_to_me
https://server/folder/project/issues?scope=assigned_to_me&state=opened

til
  • 832
  • 11
  • 27
  • [Gitlab Users API](https://docs.gitlab.com/ce/api/users.html) provide methods to get these information. What more do you need ? – Nicolas Pepinster Aug 29 '19 at 09:15
  • can you please indicate where exactly the api provides the method to get the userinformation (id or username) of the account which is being used to send the request? All I can find is 'id (required) - The ID of a user' - apparently I'm struggling with the 'required' part. – til Sep 04 '19 at 13:16
  • The Users API doesn't provide the information of the currently logged/authenticated in user – Nicolas Pepinster Sep 06 '19 at 11:28
  • which of your comments is now correct? – til Sep 06 '19 at 14:06

1 Answers1

9

List current user: Gets currently authenticated user.

GET /user

example: https://gitlab.example.org/api/v4/user.

roipoussiere
  • 5,142
  • 3
  • 28
  • 37
  • cool - with a small script this can lead to a working solution. I'll mark as complete, as this answers how I asked the question. Nevertheless, it would be great to have a possibility to use a default id, which leads back to the real id, to use in filters (eg -1) – til Apr 29 '20 at 11:43
  • 1
    This answers the question "How can I retrieve the currently logged in user?". If you want to the the issues of a specific user, see https://docs.gitlab.com/ee/api/issues.html: there is a parameter `author_id`. There is also the parameter `scope`, to filter the issues *created_by_me* or *assigned_to_me*. – roipoussiere Apr 30 '20 at 09:58