Wednesday, 15 February 2012

SQL query to retrieve users who logged into Jira for a given duration


SELECT
    user_name     AS UserName,
    display_name  AS FullName,
    email_address AS Email
FROM 
    cwd_user cu
LEFT JOIN 
    (SELECT
          user_id, attribute_value
     FROM
          cwd_user_attributes
     WHERE
          attribute_name = 'login.lastLoginMillis' 
    ) login
ON
    cu.id = login.user_id
WHERE
    lastLogin.previousLogininMillis BETWEEN ? AND ? ORDER BY user_name

NOTE: Valid for Jira 4.3.3 version and above

No comments:

Post a Comment