Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/jira.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.

query: {
startAt,
maxResults,
...(this.apiVersion === '2' ? {username: '.', includeInactive: 'true'} : {})
},
})));
}
Expand Down