Fetch user Display Name from DB

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

The purpose of this guide is to explain how to retrieve a Display Name from the database using SQL queries. To clarify, this would be the display name of the user.

An example use case for retrieving the Display Name from the database would be:

Developing scripts that do different automation tasks and you want to extract information such as the display name.

If you want to find the display name in the Jira UI, you can do that by navigating the following:

1. Click on your avatar icon located at the top right corner of the dashboard.
2. In the drop-down menu, select "Profile".

The profile page will open and you will see your display name, along with other profile details like username, email, etc. 



Environment

All environments



Solution

Use either of these queries to retrieve Display Names from your database

SELECT * FROM app_user AS au
INNER JOIN cwd_user AS cu ON cu.lower_user_name = au.lower_user_name
WHERE au.user_key LIKE 'JIRAUSER%';

SELECT lower_display_name FROM app_user AS au
INNER JOIN cwd_user AS cu ON cu.lower_user_name = au.lower_user_name; 
 


The differences between these queries are:

  • The first query gets all field data from users whose 'user_key' starts with 'JIRAUSER'. You can also specify a particular user's 'user_key' instead.
  • The second query gets only the 'lower_display_name' field for all users.

Last modified on Mar 31, 2024

Was this helpful?

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