You can do that easily using ScriptRunner for Jira. You can LoginManager to get this information.
ComponentAccessor.getComponent(LoginManager)
Ravi
I would love to see this script too. I'm trying to do this in both Jira and Confluence @Ravi Sagar _Sparxsys_ .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would love to see this script as well if you could please share it that would help a lot
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The following script can be run in the scriptrunner console and will output a list of users who have either:
- never logged in
- not logged on in *threshold* days (feel free to change this)
** no promises on this one, it seemed to work decently well for me*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You rock!
…just for the record.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@kdickason - for Confluence Cloud or Data Center?
I recommend starting a new question on Community (unless the question has been asked before, of course).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Connor Bartal - thankya! Confirmed it works in Jira 9.5.0 and ScriptRunner 7.10.0. 🙌Now to get a last login date printed next to those names...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@lester Kacprzak One given by Atlassian have a join with cwd_membership will will remove non licensed users I have removed it in below query try this.
SELECT d.directory_name, u.user_name, TO_DATE('19700101','yyyymmdd') + ((attribute_value/1000)/24/60/60) as last_login_date
FROM cwd_user u
JOIN
(
SELECT *
FROM cwd_user_attributes ca
WHERE attribute_name = 'login.lastLoginMillis'
) a ON a.user_id = u.ID
JOIN cwd_directory d ON u.directory_id = d.ID
order by last_login_date desc
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This worked. We use AD auth,
Was trying to get USER info along with AD groups associated to users. Following is my query
SELECT
u.user_name,
u.LOWER_DISPLAY_NAME,
m.LOWER_PARENT_NAME,
u.EMAIL_ADDRESS,
TO_DATE('19700101','yyyymmdd') + ((attribute_value/1000)/24/60/60) as last_login_date
FROM JIRA.CWD_USER u
JOIN
(
SELECT *
FROM JIRA.cwd_user_attributes ca
WHERE attribute_name = 'login.lastLoginMillis'
) a ON a.user_id = u.ID
JOIN JIRA.CWD_MEMBERSHIP m ON m.child_id = u.ID
order by last_login_date desc
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Connor Bartal _ worked great with additional filters and statements modified it gives the total no. of logged in users per today with threshold = 0
and this script covers lot of use cases.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
SELECT
u.user_name,
u.LOWER_DISPLAY_NAME,
m.LOWER_PARENT_NAME,
u.EMAIL_ADDRESS,
TO_DATE('19700101','yyyymmdd') + ((attribute_value/1000)/24/60/60) as last_login_date
FROM JIRA.CWD_USER u
JOIN
(
SELECT *
FROM JIRA.cwd_user_attributes ca
WHERE attribute_name = 'login.lastLoginMillis'
) a ON a.user_id = u.ID
JOIN JIRA.CWD_MEMBERSHIP m ON m.child_id = u.ID
order by last_login_date desc
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @lester Kacprzak,
This is a free app and I have used this quite often on different occasions; Jira User Export.
Thanks,
Moga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately this app isn't free (at least as of January 2023).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Iester
if you have access to the used db you can use the sql query provided at https://confluence.atlassian.com/jirakb/find-the-last-login-date-for-a-user-in-jira-server-363364638.html
All the best
Kurt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.