root / tracregator / trunk / report.sql

Revision 47, 0.5 kB (checked in by akaihola, 2 years ago)

[djac] Added SQL query to use for Djac access on Trac sites.

Line 
1SELECT
2   t.milestone AS __group__,
3   m.due,
4   t.id AS ticket, t.summary, t.component, t.status, 
5   t.resolution, t.version, t.type,
6   p.value as priority_value, t.priority, t.owner,
7   t.changetime AS modified, t.time, t.reporter
8  FROM ticket t
9  LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
10  LEFT JOIN milestone m ON t.milestone = m.name
11  ORDER BY (milestone IS NULL), milestone DESC, (status = 'closed'), 
12        (CASE status WHEN 'closed' THEN modified ELSE (-1)*p.value END) DESC
Note: See TracBrowser for help on using the browser.