We are using Trac to handle support for our clients. I wonder if there is a way to create a report to help us identify the tickets unanswered. That is the ones where the last comment is not from the owner.
Any idea how to do that ?
It won't be too difficult with a little SQL knowledge. Take a look at Trac's Database Schema:
You get the owner
field from the ticket
table and join
with the ticket-change
table by ticket.id
and ticket-change.ticket
to get the comment information.
I'm not sure this is the best approach however. You should just set all answered tickets to closed
and then use the report for showing any open
tickets. Or modified the workflow to better suit the process by adding a unanswered
stage.
Thanks for giving me the direction. I have started from an existing report and have managed to do what I want, changing it to this SQL query :
SELECT DISTINCT p.value AS __color__, id AS ticket,
summary, component, milestone, t.type AS type, status, resolution,
t.time AS created, changetime AS modified, reporter AS _reporter
FROM ticket t
LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
LEFT JOIN ticket_change tc ON id = tc.ticket
WHERE owner = $USER AND status <> 'closed' AND t.type = 'support' AND
(owner != (SELECT author FROM ticket_change WHERE time =
(SELECT MAX(tc.time) FROM ticket_change tc WHERE tc.ticket = id)))
ORDER BY CAST(p.value AS integer), tc.time, milestone, t.type
If that can help someone...