Fossil SCM

Example for report coloring by priority is wrong

Closed

8f7e657c693bfb4… · opened 16 years, 2 months ago

Type
Code_Defect
Priority
Severity
Minor
Resolution
Overcome_By_Events
Subsystem
Created
Feb. 12, 2010 2:07 a.m.

The example below is wrong. The reason ? According to the common TH1 code for reports priority is a TEXT column with values 'Immediate' ... 'Zero'. The example on the other hand assumes priority to be INT in range 1 ... 5.

SELECT
  CASE priority WHEN 1 THEN '#f2dcdc'
       WHEN 2 THEN '#e8e8bd'
       WHEN 3 THEN '#cfe8bd'
       WHEN 4 THEN '#cacae5'
       ELSE '#c8c8c8' END as 'bgcolor',
...
FROM ticket

The code I am now using my ticket setup is

CASE priority
   WHEN 'Immediate' THEN '#f2dcdc'
   WHEN 'High'      THEN '#e8e8bd'
   WHEN 'Medium'    THEN '#cfe8bd'
   WHEN 'Low'       THEN '#cacae5'
   ELSE                  '#c8c8c8'
   END as 'bgcolor',

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button