Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getUsers() for api version 2 #362

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Just-Web-Developer
Copy link

Added compatiblity of function "getUsers" with api version 2

Fix of function "getUsers" for api version 2
src/jira.js Outdated
@@ -829,10 +829,11 @@ export default class JiraApi {
*/
getUsers(startAt = 0, maxResults = 100) {
return this.doRequest(this.makeRequestHeader(this.makeUri({
pathname: '/users',
pathname: this.apiVersion === '2' ? '/user/search' : '/users',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/rest/api/2/user/searh appears to be an alias for /rest/api/2/users: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-users/#api-rest-api-2-users-get

This change shouldn't be needed? Could you provide some more context?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/rest/api/2/users doesn't worked for a local copy of Jira, but /rest/api/2/user/searh worked well. Now, I checked it with cloud Jira and got the opposite result, /rest/api/2/user/searh doesn't work but /rest/api/2/users do. Maybe it would be usefull to add an additional parameter that would indicate whether the request sent to a local Jira or not.

Added "local" an additional parameter that would indicate whether the request sent to a local Jira or not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants