It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Users never logged in

Rumceisz Jun 13, 2012

Hi All,

we reached the maximum user limit in Jira. Of course we ordered the new license but we have to wait a couple of days.

For this reason and other (consolidation) we would like to delete those users that have never logged in. Hence we have 2000 users, is there a script which results the users that had never entered to the Jira?

It would be very necessary.

Thanks for your help!

Rumi

3 answers

1 accepted

1 vote
Answer accepted
Mizan Ali Sayed Jun 13, 2012

I dont know confluence database ,but from the administration you can view the last login of the user , based on that you can figure out which user did not log in since the begining of time :)

you can refer this answer which provides a macro which displays all users and their last successful login date

3 votes
Mizan Ali Sayed Jun 13, 2012

You will have to fire a Sql query on the Jira database which will retrieve only those users with login count as 0 . then you can delete or deactivate these users .

Have a look at these sample query

The below query should give you user ids with login count zero

select * from cwd_user_attributes where attribute_name = 'login.count'and attribute_value='0';

Rumceisz Jun 13, 2012

Very helpful!

Thank you very much!

Mizan Ali Sayed Jun 13, 2012

WC ,

below script is for username and id

select userbase.username ,userbase.id from userbase ,cwd_user_attributes  where userbase.id=cwd_user_attributes.user_id and attribute_name='login.count' and attribute_value='0';

Rumceisz Jun 13, 2012

Hi Mizan,

can you please extend the query: we also need the users who has never logged into Confluence.

Can you please help?

The reason: we use common user management in Jira and Confluence. This means that we create the user in Jira and grant them confleunce-user membership too. In the user account confirmation email we send the users a reset password link where they can set a new password. Question: when they click on the link and set a new password, does this mean a recorded Jira login?

I mean they only set a password but don't enter to Jira. Notice, that without setting the password they cannot enter Confluence too.

Thanks in advance again!

And sorry for the inconvinience!

Rumi

Tom Ghormley Oct 16, 2013

What if you aren't using Crowd for authentication? We use OSuser to point to our LDAP server so there is no such thing as "cwd_user" in our SQL tables.

Vince Eagen Jan 10, 2017

For crowd / active directory the query is:

SELECT u.user_name, attr.attribute_name, attr.attribute_value
FROM jira.cwd_user u, jira.cwd_user_attributes attr
WHERE u.id = attr.user_id AND attribute_name = 'login.count'
AND attribute_value = '0';

 

0 votes
Diego Cañete Dec 11, 2018

Dear JIRA - Team,

this should be a basic function, since every year we must in our case answer audits and this we must do via query to the database, because they do not pinpoint in incorporating this to Jira? In addition to being able to expose the list of active members, groups and permits. They are all administrative tasks that are very necessary today and we re-solve them with querys.

Thank you.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira

Try Jira Cloud for Outlook: Organize your work without leaving your inbox

Hi Atlassian community, My name is Max and I work on the product integration team at Atlassian. I am pleased to announce the early access program for the Jira Cloud add-in for Outlook. This add-in...

2,010 views 6 15
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you