Search code examples
trac

How to create a Trac report containing all tickets needing an answer?


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 ?


Solution

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