{7} My Tickets

This report demonstrates the use of the automatically set USER dynamic variable, replaced with the username of the logged in user when executed.

Report execution failed:
InternalError: (3065, u"Expression #1 of ORDER BY clause is not in SELECT list, references column 'trac_weblawyer.t.owner' which is not in SELECT list; this is incompatible with DISTINCT")

SELECT COUNT(*) FROM (
SELECT DISTINCT
       p.value AS __color__,
       (CASE
         WHEN owner = %s AND status = 'accepted' THEN 'Accepted'
         WHEN owner = %s THEN 'Owned'
         WHEN reporter = %s THEN 'Reported'
         ELSE 'Commented' END) AS __group__,
       t.id AS ticket, summary, component, version, milestone,
       t.type AS type, priority, t.time AS created,
       t.changetime AS _changetime, t.description AS _description,
       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 tc.ticket = t.id AND tc.author = %s
                                AND tc.field = 'comment'
  WHERE t.status <> 'closed'
        AND (owner = %s OR reporter = %s OR author = %s)
  ORDER BY (owner = %s AND status = 'accepted') DESC,
           owner = %s DESC, reporter = %s DESC,
           CAST(p.value AS signed), milestone, t.type, t.time

) AS tab
Note: See TracReports for help on using and creating reports.