Search code examples
fogbugzfogbugz-api

How to get logged in user id


I am currently trying to find which id the logged in user has, but the documentation does not show any clue whatsoever indicating how this can be achieved.

I need to know the logged in user id to tell whether or not the user is working on a case so he can start/stop accordingly.

Since the API only returns the ids of the users currently working on each case, there is no other way for me to show the user if he is working on that case without knowing his id.

I was expecting this id to be provided after successful login, but it is not and I cannot find a way to discover the id.

Is there even such a way? If there is then how can I get it through the API?


Solution

  • So I finally found a way to discover the logged in user ID, the command is viewPerson without passing a user id:

    Takes only ixPerson OR sEmail. If no parameters are supplied, the user currently logged in is returned.

    http://help.manuscript.com/the-fogbugz-api/users#View_a_User_cmdviewPerson

    As to why this eluded me was due to the wrong description of the command return, which states the following:

    The case number of the edited case.

    Now I am able to cross-check the id with any case I need to find out whether or not the logged in user is working on a certain case.