Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I list all user in a project as well as their last login date and time ?

Ronny June 27, 2018

Hi there,

I try to pull up some data for our users in a specific project in terms of their last login date.

Our database is in postgresql, Im just trying to find a query to do so.

 

I can pull the list of user for our specfic project but Im having dificulty in finding the right query to add "last login date" on that query.

1 answer

1 accepted

1 vote
Answer accepted
Alexey Matveev
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.
June 27, 2018
Ronny June 27, 2018

Hi there,

I have actually checked this solution, however this query will show for all Jira users.

I just need the specific users from a project.

Ronny June 27, 2018

I tried this query but it does not work, :

 

SELECT A.user_name, to_timestamp(CAST(B.attribute_value AS bigint)/1000)
FROM cwd_user A , cwd_user_attributes B
WHERE B.user_id = A.id
AND B.attribute_name = 'lastAuthenticated'
INNER JOIN
projectroleactor P
ON A.USER_NAME = P.ROLETYPEPARAMETER
where pid = '16026'

Alexey Matveev
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.
June 27, 2018

I would write this query like this:

SELECT A.user_name, to_timestamp(CAST(B.attribute_value AS bigint)/1000)
FROM cwd_user A , cwd_user_attributes B, projectroleactor P
WHERE B.user_id = A.id
AND B.attribute_name = 'lastAuthenticated'
AND  A.USER_NAME = P.ROLETYPEPARAMETER
AND pid = '16026'

Ronny June 28, 2018

Thank you @Alexey Matveev

It Works :)

Alexey Matveev
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.
June 28, 2018

You are welcome!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events