Jira shows duplicates in user picker
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When searching for a user in a user picker – such as the assignee field – the component returns duplicates.
Environment
- Any Jira version.
- Two or more user directories.
This article assumes a Jira environment with the internal directory enabled and one external directory. An identical diagnosis and solution apply to a situation with multiple external directories. In that scenario, replace directory_id = 1
with the directory ID of the shadowed database.
Diagnosis
Health Check
The duplicate user accounts health check may be failing.
User management admin pages
The directory column of the users admin page will display whichever directory is on top.
When the internal (shadowed) directory is on top
When the external (shadowing) directory is on top
Database
Query your database for shadowed users
SELECT lower_user_name, COUNT(*) FROM cwd_user GROUP BY lower_user_name HAVING COUNT(*) > 1;
If any users are returned, you shadowed users. One or more of your user directories contains users with identical usernames to another directory.
Query detailed attributes of shadowed users (optional)
SELECT a.*
FROM cwd_user a
JOIN (SELECT lower_user_name, COUNT(*) FROM cwd_user GROUP BY lower_user_name HAVING COUNT(*) > 1) b
ON a.lower_user_name = b.lower_user_name;
Depending on the size of your organization and the number of shadowed users, these queries can be resource intensive.
Cause
As reported in - JRASERVER-68456Getting issue details... STATUS , shadowed users appear as duplicates in some areas of Jira's interface. These duplicate entries are not distinct – they each have the same username, profile, comments, assigned issues, etc.
Due to how Jira manages and queries its internal directory and external directory cache, accounts with the same username will sometimes be amalgamated and, at other times, be separated.
Solution
You must either deactivate or delete the internal, shadowed user to work around this bug. We recommend deleting the shadowed user if you never plan on logging in again via the internal directory.
Locate your external directory ID
- While logged in as a Jira administrator, navigate to ⚙️ > User management > User directories.
- Click the directory configuration summary link at the bottom.
- Locate your external directory and copy its directory ID.
Current user:
[...]
Directory 1:
Directory ID: 1
Name: Jira Internal Directory
Active: true
Type: INTERNAL
[...]
Directory 2:
Directory ID: 10000
Name: LDAP server
Active: true
Type: CONNECTOR
[...]
In this example, the internal directory ID is 1 and the external directory ID is 10000.
Option 1: Deactivate shadowed users
Option 2: Delete shadowed users
Restart Jira
Since Jira caches user data, a complete restart is required to flush the duplicate user data from the application cache.