プロジェクト

全般

プロフィール

Vote #80329

未完了

REST API: users: add support for status=*

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Resolved
優先度:
通常
担当者:
-
カテゴリ:
REST API_32
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
32
version_id:
0
issue_org_id:
32090
author_id:
153583
assigned_to_id:
0
comments:
4
status_id:
3
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Resolved]

説明

Currently, the /users.:format REST API will default to status=1 (active), that is, when you attempt to search for a certain user (@redmine-admin.auth@ contains an API token of an administrator in the format @-u TOKEN:x@):

curl -H 'Content-Type: application/json' \
  -G -K redmine-admin.auth \
  'https://redmine.example.com/users.json?name=firstname.lastname'

it will only return the requested account when the account is active. This means that I have to make two request for @status=1@ and @status=3@ to find a user when I don't know if the account is locked or not :(

I would have suspected that @status=@ would return all kinds of users, similarly to how it works for Rest Issues with @status_id=@, but this is apparently not the case.


journals

You can get users with any status by adding 'status=' parameter.

<pre>
curl --user admin:password 'http://redmine.example.com/users.json?status='
</pre>
--------------------------------------------------------------------------------
Go MAEDA wrote:
> You can get users with any status by adding 'status=' parameter.

That does exactly what I wanted, thanks! I've updated the wiki accordingly.

--------------------------------------------------------------------------------
Hm, there is one other issue I've stumbled over - @users.json?name=foobar&status=@ won't return the status of the matched users. I either have to query the statuses separately (@users.json?name=foobar&status=1@ and so on) so I know that all matched users have the status I just queried, or I have to query each returned user separately with @users/<id>.json@ to get the user's status. Is that intentional, or could a @status@ field be added to @users.:format@?
--------------------------------------------------------------------------------
This is so extremly not obvious.
Is it possible to update documentation to point to that feature?
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリREST API_32 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0