Finding duplicate user accounts

Still need help?

The Atlassian Community is here for you.

Ask the community

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

You can get the total number of duplicate user accounts by calling the count 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/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 System Administrators can also flush the cache manually by adding the flush=true query string parameter to the resource URL. For example:

curl -X GET "<BASE_URL>/rest/api/2/user/duplicated/list?flush=true" \
   -u "<USERNAME>:<PASSWORD>"
Last modified on Aug 5, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.