I created several TracReports, but trying to do this using SQL, I do not get the expected result. This was my SQL query:
SELECT p.value AS __color__,
reporter AS __group__,
id AS ticket, summary, resolution , component,
t.type AS type, priority, severity, time AS created,
changetime AS modified,
changetime AS __changetime, description AS _description,
reporter AS _reporter
FROM ticket t
LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
WHERE t.status = 'closed'
ORDER BY changetime DESC, CAST(p.value AS integer), milestone, t.type, time
Using this query, the reporter group does not work at all. I get a few lines for each reporter. So I tried to get the result using the "Custom Request" function. This triggered my expected result with the following TracQuery:
query:?status=closed
&group=reporter
&col=id
&col=summary
&col=resolution
&col=component
&col=type
&col=priority
&col=severity
&col=time
&col=changetime
&order=changetime
&desc=1
My question is: can I convert TracQuery to an SQL statement or can I see the SQL statements that execute in the backend? I ask because I want to be able to use some of the columns or use other SQL functions.
source
share