Finding duplicate user accounts

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

As of release 8.19.0, the Jira platform REST API api/2/user resource provides additional count and list methods that you can use to get the total number of duplicate user accounts or the full list of such accounts.

An account is considered as duplicate if another active account with the same name exists in another user directory, or if a user has multiple accounts and their only active account is not in the directory with the highest priority.

On this page:

Get the total number of duplicate user accounts

count メソッドを呼び出すことで重複したユーザー アカウントの合計数を取得できます。ここで <BASE_URL> は Jira インスタンスの URL で <USERNAME>:<PASSWORD> は Jira のユーザー名とパスワードです。

curl -X GET "<BASE_URL>/rest/api/2/user/duplicated/count" \
  -u "<USERNAME>:<PASSWORD>"

The response is a dictionary with a count property that stores the total number of duplicate user accounts. For example:

{
  "count": 1
}

Get a detailed list of duplicate accounts

You can get a list of all the duplicate user accounts by calling the list method, where <BASE_URL> is the URL of your Jira instance and <USERNAME>:<PASSWORD> are your Jira username and password:

curl -X GET "<BASE_URL>/rest/api/2/user/duplicated/list" \
  -u "<USERNAME>:<PASSWORD>"

The response is a dictionary listing each duplicate user account as a separate property that stores an array of objects. Each object in the array contains the user directory ID, the directory name, and a boolean flag indicating whether the account is active. For example:

{
  "johndoe": [
    {
      "directoryId": 1,
      "directoryName": "Jira Internal Directory",
      "userActive": true
    },
    {
      "directoryId": 10000,
      "directoryName": "Crowd Server",
      "userActive": true
    }
  ]
}

Response cache

The responses returned by the count and list methods are stored in the cache for 10 minutes. The cache is flushed automatically every time a directory is added, deleted, enabled, disabled, reordered, or synchronized.

Jira システム管理者は、リソースの URL に flush=true クエリ文字列パラメーターを追加することで、キャッシュを主導でフラッシュすることもできます。例:

curl -X GET "<BASE_URL>/rest/api/2/user/duplicated/list?flush=true" \
   -u "<USERNAME>:<PASSWORD>"
最終更新日 2021 年 8 月 5 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.