Jira version: 5.2.2
database: mysql
I would like to check user activity to see how long a user is taking to perform a certain task. Based on a query from JRA-12825, i perform this query(not quite optimized yet)
SELECT c.pname, b.`CALLER`,
MIN(TIMEDIFF(b.`FINISH_DATE`, b.`START_DATE`)) as minTime,
MAX(TIMEDIFF(b.`FINISH_DATE`, b.`START_DATE`)) as maxTime,
SEC_TO_TIME(AVG(TIME_TO_SEC(TIMEDIFF(b.`FINISH_DATE`, b.`START_DATE`)))) as average,
SEC_TO_TIME(STDDEV(TIME_TO_SEC(TIMEDIFF(b.`FINISH_DATE`, b.`START_DATE`)))) as stdDev,
COUNT(1) as cnt
FROM os_historystep b, jiraissue a, issuestatus c
where (a.`ID` = b.`ENTRY_ID`) and (a.`PROJECT` = 10000) and b.STEP_ID = c.sequence and b.ACTION_ID != 0
group by pname, CALLER
I assume that Jira is automatically inserting a record when b.ACTION_ID = 0, so I ignore those records.
Problem--This query does not take into account when a user reassigns a task to another user. For instance, user Amy is assigned a task and reassigns the task to user Bob(without changing the status of the task). User Bob eventually closes the task, but user Amy is charged with the entire time until the status of the task changes.
Question--Is there a way to remove the tasks from the query that have been reassigned to someone else and just select results that have not been handled by multiple users? or is there a better way?