#2288: Date/time based ticket queries
--------------------------------------+-------------------------------------
 Reporter:  [EMAIL PROTECTED]          |        Owner:  jonas
     Type:  enhancement               |       Status:  new  
 Priority:  normal                    |    Milestone:  1.0  
Component:  ticket system             |      Version:  0.9  
 Severity:  normal                    |   Resolution:       
 Keywords:  ticket custom query date  |  
--------------------------------------+-------------------------------------
Changes (by [EMAIL PROTECTED]):

  * cc:  => [EMAIL PROTECTED]

Comment:

 I do a similar report to show a list of recently modified tickets.  We'd
 like to transition to just using the Query module, but this is a pretty
 popular report.

 {{{
 #!sql
 SELECT
    (CASE status
       WHEN 'closed' THEN 'color: #777; background: #ddd; border-color:
 #ccc;'
       ELSE
         (CASE owner WHEN '$USER' THEN 'font-weight: bold' END)
     END) AS __style__,
    e3.value AS __color__,
    status AS __group__,
    id AS ticket,
    priority,
    t.type AS type, severity,
    time as created,
    changetime as modified,
    reporter,
    (CASE status WHEN 'assigned' THEN owner||' *' ELSE owner END) AS owner,
    summary
   FROM ticket AS t, enum AS e, enum AS e2, enum AS e3
   WHERE
    e.name = t.priority AND
    e.type = 'priority' AND
    e2.name = t.status AND
    e2.type = 'status' AND
    e3.name = t.severity AND
    e3.type = 'severity' AND
    (strftime('%%s','now') - changetime) < (7 * 24 * 3600)
   ORDER BY e2.value, resolution, -changetime
 }}}

-- 
Ticket URL: <http://projects.edgewall.com/trac/ticket/2288>
The Trac Project <http://trac.edgewall.com/>
_______________________________________________
Trac-Tickets mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-tickets

Reply via email to