[rt-users] Color ColumnMap with SLA Column

Steve OBrien steve.obrien at hdesd.org
Mon Feb 23 15:35:37 EST 2009


Hi All,
I am using the ShowStatusInColor extension and the SLA Extensions and
would like my tickets' SLA fields to show up in color as well but I
cannot seem to get the query syntax correct in the ColorMap script.  I
basically edited the Priority ColorMap but it cannot compile because I
can't get the correct column name for my custom field.  here is what I
have:
[snip]
89 # Set the SLA numbers to a colour.
 90 sub SLAInColor {
 91         my $Ticket = shift;
 92 
 93         my $sla = $Ticket->CF.{SLA};
 94         my $colors = undef;
 95 
 96 # Change priority numbers to reflect your priority system.
 97         if ($sla == 'System Inoperable') {
 98                 $colors = "#FF0000";
 99        } elsif ($sla == 'Service Impaired') {
100                $colors = "#FF2000";
101        } elsif ($sla == 'General Inquiry') {
102                 $colors = "#FF4000";
103         }
104 
105         if ($colors) {
106                 $sla = "<div style=\"color: $colors;\">$sla</div>"
107         }
108 
109                 return \"<b>$sla</b>";
110 }
[snip]

the offending line is:
93         my $sla = $Ticket->CF.{SLA};

It doesn't like the CF.{SLA} I have tried CustomField.{SLA}, CustomField
\.\{SLA\}, CF\.\{SLA\}, and SLA.  It does not seem to like my \ which I
thought was a perfectly perlish way to escape a character....
The Field description name is SLA Priority, I have tried that as well. 

TIA,
Steve




More information about the rt-users mailing list