Actions
Defect #38165
closedUsers API ignores name and group_id parameter
Added by Go MAEDA almost 2 years ago. Updated 11 months ago.
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
REST API
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
Users API with a group_id
parameter is supposed to return users who are members of the given group (see Rest_Users).
It works as expected in 5.0-stable but does not work in the current trunk (I tested in r22012). Even if you pass the group_id parameter, it returns all users. The group_id parameter is ignored.
$ curl --user admin:password http://localhost:3000/users.json?group_id=10 | jq . { "users": [ { "id": 8, "login": "miscuser8", "admin": false, "firstname": "User", "lastname": "Misc", "mail": "miscuser8@foo.bar", "created_on": "2006-07-19T17:33:19Z", "updated_on": "2006-07-19T17:33:19Z", "last_login_on": null, "passwd_changed_on": null, "twofa_scheme": null, "custom_fields": [ { "id": 4, "name": "Phone number", "value": null }, { "id": 5, "name": "Money", "value": null } ] } ], "total_count": 1, "offset": 0, "limit": 25 }
$ curl --user admin:admin http://localhost:3000/users.json?group_id=10 | jq . { "users": [ { "id": 1, "login": "admin", "admin": true, "firstname": "Redmine", "lastname": "Admin", "mail": "admin@somenet.foo", "created_on": "2006-07-19T17:12:21Z", "updated_on": "2006-07-19T20:57:52Z", "last_login_on": "2023-01-11T00:22:59Z", "passwd_changed_on": null, "twofa_scheme": null, "custom_fields": [ { "id": 4, "name": "Phone number", "value": null }, { "id": 5, "name": "Money", "value": null } ] }, { "id": 3, "login": "dlopper", "admin": false, "firstname": "Dave", "lastname": "Lopper", "mail": "dlopper@somenet.foo", "created_on": "2006-07-19T17:33:19Z", "updated_on": "2006-07-19T17:33:19Z", "last_login_on": null, "passwd_changed_on": null, "twofa_scheme": null, "custom_fields": [ { "id": 4, "name": "Phone number", "value": "" }, { "id": 5, "name": "Money", "value": null } ] }, { "id": 2, "login": "jsmith", "admin": false, "firstname": "John", "lastname": "Smith", "mail": "jsmith@somenet.foo", "created_on": "2006-07-19T17:32:09Z", "updated_on": "2006-07-19T20:42:15Z", "last_login_on": "2006-07-19T20:42:15Z", "passwd_changed_on": null, "twofa_scheme": null, "custom_fields": [ { "id": 4, "name": "Phone number", "value": "01 42 50 00 00" }, { "id": 5, "name": "Money", "value": null } ] }, { "id": 8, "login": "miscuser8", "admin": false, "firstname": "User", "lastname": "Misc", "mail": "miscuser8@foo.bar", "created_on": "2006-07-19T17:33:19Z", "updated_on": "2006-07-19T17:33:19Z", "last_login_on": null, "passwd_changed_on": null, "twofa_scheme": null, "custom_fields": [ { "id": 4, "name": "Phone number", "value": null }, { "id": 5, "name": "Money", "value": null } ] }, { "id": 9, "login": "miscuser9", "admin": false, "firstname": "User", "lastname": "Misc", "mail": "miscuser9@foo.bar", "created_on": "2006-07-19T17:33:19Z", "updated_on": "2006-07-19T17:33:19Z", "last_login_on": null, "passwd_changed_on": null, "twofa_scheme": null, "custom_fields": [ { "id": 4, "name": "Phone number", "value": null }, { "id": 5, "name": "Money", "value": null } ] }, { "id": 4, "login": "rhill", "admin": false, "firstname": "Robert", "lastname": "Hill", "mail": "rhill@somenet.foo", "created_on": "2006-07-19T17:34:07Z", "updated_on": "2006-07-19T17:34:07Z", "last_login_on": null, "passwd_changed_on": null, "twofa_scheme": null, "custom_fields": [ { "id": 4, "name": "Phone number", "value": "01 23 45 67 89" }, { "id": 5, "name": "Money", "value": null } ] }, { "id": 7, "login": "someone", "admin": false, "firstname": "Some", "lastname": "One", "mail": "someone@foo.bar", "created_on": "2006-07-19T17:33:19Z", "updated_on": "2006-07-19T17:33:19Z", "last_login_on": null, "passwd_changed_on": null, "twofa_scheme": null, "custom_fields": [ { "id": 4, "name": "Phone number", "value": null }, { "id": 5, "name": "Money", "value": null } ] } ], "total_count": 7, "offset": 0, "limit": 25 }
Related issues
Updated by Go MAEDA almost 2 years ago
This is due to r21823. Because of the implementation of the query system for users list, UsersController#index
no longer handles the group_id parameter.
Updated by Go MAEDA almost 2 years ago
- Subject changed from Users API ignores group_id parameter to Users API ignores name and group_id parameter
It ignores the name
parameter too.
Updated by Go MAEDA 11 months ago
- Related to Patch #39181: /users backwards API compatibility added
Actions