Question

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 ?

Was it helpful?

Solution 2

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...

OTHER TIPS

It won't be too difficult with a little SQL knowledge. Take a look at Trac's Database Schema:

enter image description here

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top