Finding the inactive users with respective project

srrekanth March 11, 2013

Is there any mysql for getting inactiveusers with respetive projects

4 answers

1 vote
Udo Brand
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 12, 2013

The query should look like this:

select user_name, ua.attribute_value LAST_LOGIN_IN_MILLIS
from cwd_user u, cwd_user_attributes ua
where u.id = ua.user_id and ua.attribute_name ='login.lastLoginMillis'
and to_number(ua.attribute_value) < (select max(to_number(attribute_value))-15552000000  -- minus 180 Days
     from cwd_user_attributes
     where attribute_name ='login.lastLoginMillis')

Please note this query is for Oracle you need to adapt it to MySQL. It shows all User with last Login 180 days before today (assuming someone logged in today)

0 votes
Sam Omidi November 18, 2015
marshall_craig December 30, 2015

This query looks like it only lists those who have already been formally identified as inactive.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 30, 2015

That's correct, it will only find users already as inactive.

0 votes
J. Caldwell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 11, 2013

I would point out that Nic is correct. If the definition is "hasn't signed in in 6 months...", it is really irrelevant to be concerned about the specific projects.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 11, 2013

You need to define "inactive" users somehow. I've got users who use systems for reading - they might be considered inactive because they don't contribute, but for us, definitely are NOT inactive.

Would also help if you told us which system you are looking at? Is it Jira?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 11, 2013

Repeating the same question is not helpful.

Yes, Jira, thank you. Now, again, what do you mean by "inactive"? And then "respective projects"?

srrekanth March 11, 2013

Hi Nic,

Thanks for quick reply...

I need mysql query where we get inactive users asscosiated with respective projects data in JIRA.

srrekanth March 11, 2013

Hi Nic,

Inactive means users who have not logine jira for a period of SIX months.Say let us assume we have 100 projects in jira in this projects we have inactive projects in this inactive projects we have inactive users.so i need a query which can get inactive project and users asscioated with this project.

Thanks,

Harsha

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 11, 2013

Ok, that's better. This is a task you probably want to split into two parts.

An inactive user is someone who hasn't logged in for 6 months. In the UI, an admin can simply look at the user's profile to see their last login date. The activity gadget on their profile will even tell you the last time they touched data as well. From memory, in SQL, look at the table CWD_USER to see the last login date.

Once you've id'd an inactive user, then you need to think about "associated with project" - what is this association? Do you mean they're in a role in the project? Something else? I just remove all groups and roles from "inactive" users wholesale, it's not really worth working out the details...

Like Farida Musayeva likes this

Suggest an answer

Log in or Sign up to answer