Hi thanks for your help
Can we get the list of users who not logged in more than 3 months in jira, confluence and bitbucket?
Is this possible using groovy? can we automate to send a report?
Pls help with the same same
Thanks,
Prasad
For Jira you can use this:
LoginManager loginManager = ComponentAccessor.getComponentOfType(LoginManager)
loginManager.getLoginInfo(userName).getLastLoginTime()
Since you're on Jira-Server (recall that support is soon going away - consider moving to Data Center like we did or to Cloud) and have a local database, you or your DBA can run a query like the following if you're running MySQL (will need to modify if you're running a different DB) for Jira. Likely something similar for Confluence and Bitbucket.
select user_name,display_name,DATE_FORMAT(from_unixtime(attribute_value/1000),'%Y/%m/%d') as last_login
from cwd_user u
left join cwd_user_attributes ua on ua.user_id = u.ID
where active = 1
and attribute_name = 'login.lastLoginMillis'
and from_unixtime(attribute_value/1000) < date_sub(now(),INTERVAL 90 day)
order by attribute_value desc
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.