andygrunwald / go-jira

Go client library for Atlassian Jira
https://pkg.go.dev/github.com/andygrunwald/go-jira?tab=doc
MIT License
1.48k stars 471 forks source link

[bug] Jira Server user search API triggers 404 error with accountID #301

Open kopytovs opened 4 years ago

kopytovs commented 4 years ago

Describe the bug

Current Jira Server API has user search method which unavailable after https://github.com/andygrunwald/go-jira/commit/f50cb07b297d79138b13e5ab49ea33965d32f5c1

To Reproduce

  1. Use Jira Server API
  2. Try to search user with accoundID user, _, error := client.User.Get(accountID)
  3. Catch error Either the 'username' or the 'key' query parameters need to be provided: request failed. Please analyze the request body for more details. Status code: 404

Expected behavior

No reproduce 404 error with valid request

https://docs.atlassian.com/software/jira/docs/api/REST/8.9.0/#api/2/user-findUsers

Possible Solution

Add both (Cloud and Server) compatibility

Your Environment

Include as many relevant details about the environment you experienced the problem in

github-actions[bot] commented 4 years ago

Hi! Thank you for taking the time to create your first issue! Really cool to see you here for the first time. Please give us a bit of time to review it.

ghostsquad commented 4 years ago

We are currently working on V2 which will have better compatibility between server and cloud versions.

kopytovs commented 4 years ago

@ghostsquad 👍

ghostsquad commented 4 years ago

In the mean time, if you have some ideas on how to fix this issue, we happily accept PRs!

ghostsquad commented 4 years ago

I think the solution is to implement a new method like GetByUsername, which would have the old code prior to the "bugfix" which apparently only fixed cloud versions, but broke server versions.

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity in the last 60 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.