I'm trying to write a report which will list all tickets, open or
closed, by user. My first attempt looked like this:
SELECT owner AS __group__,
id AS ticket,
time, changetime, component, severity, priority, owner, reporter, cc,
url, version, milestone, status, resolution
FROM ticket
ORDER BY changetime DESC
Unfortunately, the groups don't seem to work properly; groups for each
user appear several times. I initially thought this was only separating
open/closed tickets, so I added WHERE clause:
WHERE status!='closed'
While this eliminated closed tickets, there appears to be a group for
each user on each day. I'll include a sample output:
__group__,ticket,owner,time,changetime,component,severity,priority,reporter,cc,url,version,milestone,status,resolution
uma,6,uma,1086637011,1086637011,Util,normal,normal,cap,None,None,None,None,new,None
uma,5,uma,1086635796,1086635796,CSGA,normal,normal,cap,None,None,None,None,new,None
cap,2,cap,1086557055,1086557824,CS,normal,normal,cap,None,None,None,None,assigned,None
cap,4,cap,1086557416,1086557416,GA,major,normal,cap,tim,None,None,None,new,None
uma,3,uma,1086557162,1086557162,Util,normal,normal,cap,None,None,None,None,new,None
Is my SQL off or is this a bug?
--Cap
closed, by user. My first attempt looked like this:
SELECT owner AS __group__,
id AS ticket,
time, changetime, component, severity, priority, owner, reporter, cc,
url, version, milestone, status, resolution
FROM ticket
ORDER BY changetime DESC
Unfortunately, the groups don't seem to work properly; groups for each
user appear several times. I initially thought this was only separating
open/closed tickets, so I added WHERE clause:
WHERE status!='closed'
While this eliminated closed tickets, there appears to be a group for
each user on each day. I'll include a sample output:
__group__,ticket,owner,time,changetime,component,severity,priority,reporter,cc,url,version,milestone,status,resolution
uma,6,uma,1086637011,1086637011,Util,normal,normal,cap,None,None,None,None,new,None
uma,5,uma,1086635796,1086635796,CSGA,normal,normal,cap,None,None,None,None,new,None
cap,2,cap,1086557055,1086557824,CS,normal,normal,cap,None,None,None,None,assigned,None
cap,4,cap,1086557416,1086557416,GA,major,normal,cap,tim,None,None,None,new,None
uma,3,uma,1086557162,1086557162,Util,normal,normal,cap,None,None,None,None,new,None
Is my SQL off or is this a bug?
--Cap