• Community
  • Products
  • Jira Core
  • Questions
  • I have a long list of users whom I want to deactivate on JIRA. How can I find out if they have any activity on JIRA? I can deactivate only those users who have had no activity on JIRA.

I have a long list of users whom I want to deactivate on JIRA. How can I find out if they have any activity on JIRA? I can deactivate only those users who have had no activity on JIRA.

 

2 answers

1 accepted

Hi Ankita

You can use below query and run it on your JIRA database. It will let you know if the users logged into JIRA in past 90 days.

SELECT d.directory_name AS "Directory", 
 	u.user_name AS "Username",
 	from_unixtime((cast(attribute_value AS UNSIGNED)/1000),'%m/%d/%Y') AS "Last Login" 
 FROM cwd_user u
 LEFT JOIN (
 	SELECT * 
 	FROM cwd_user_attributes 
 	WHERE attribute_name = 'login.lastLoginMillis'
 	) AS a ON a.user_id = u.id
 JOIN cwd_directory d ON u.directory_id = d.id
 where cast(attribute_value AS UNSIGNED)/1000 BETWEEN UNIX_TIMESTAMP(DATE_SUB(now(),INTERVAL 90 DAY)) AND UNIX_TIMESTAMP(now())
 ORDER BY "Last Login" DESC;

You can reverse the condition and find out who have not logged in past 90 days.

Regards

Prakhar

Hi Prakhar, Thanks for your help. Our JIRA instance was recently moved to cloud. earlier it used ldap authentication. Now the issue is that, the new JIRA instance shows "never logged in" for the users who have not logged in to the new instance. so we do not know if a user has actually never logged in or just not logged in to the new instance. will this query help me in that case?

I am not sure about the cloud instance. Though attribute 

login.lastLoginMillis shows the last time user has logged in.

You might need to run few test to confirm that if this attribute's value has not been overridden while mirating your JIRA instance to cloud.

Regards

Prakhar

 

thank you Prakhar. Really appreciate your help.

0 vote

In /admin/users on your Atlassian Cloud instance every user will have "last session" next to their account that you can use to see how recently they have authenticated with your Atlassian Cloud instance.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published 12 hours ago in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

37 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you