Tomas Rudén wrote:
I really appreciate the current Report module. The SQL-query together
with formatting really gives us the ability to create reports according
to customers demand.
Ditto.
We do a complex query <beware the following SQL may make your brain
hurt> involving joining to the ticket_custom table and summing fields to
generate time reports. How on earth is the query module going to
replace that!
I suppose I should really write a plugin that provides a whole new page
to show this info but it is just so easy to configure the custom fields,
and write a report to get to where I am.
SELECT distinct t.owner AS Developer,
SUM(times.estimate) AS Estimate_On_Remaining_Tickets,
SUM(times.cumulative) AS Cumulative_Time_On_Remaining_Tickets
FROM ticket AS t,
(SELECT e.ticket AS ticket,
e.estimate AS estimate,
c.cumulative AS cumulative
FROM
(SELECT tcm2.ticket AS ticket,
(CASE WHEN (tcm2.value != '' AND tcm2.value != '0')
THEN tcm2.value ELSE
(CASE WHEN (tcm3.value != '' AND tcm3.value != '0')
THEN tcm3.value ELSE '0'END) END) AS estimate
FROM ticket_custom tcm2, ticket_custom tcm3
WHERE tcm2.ticket = tcm3.ticket
AND tcm2.name = 'currentestimatehours'
AND tcm3.name = 'estimatedtimehours') AS e,
(SELECT tcm1.ticket AS ticket,
(CASE WHEN tcm1.value != '' THEN tcm1.value ELSE '0' END) AS
cumulative
FROM ticket_custom tcm1
WHERE tcm1.name = 'cumulativehours') AS c
WHERE e.ticket = c.ticket) AS times
WHERE t.status IN ('new', 'assigned', 'reopened')
AND t.id = times.ticket
GROUP BY Developer
_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac