Customize ColumnMaps with CustomFieldValues color

Hi,

I would like to colorize a CustomField column in the RT at a Glance
page, as described in the ShowStatusInColor wiki page. It works well for
status, but I don’t get it for Customfield. What I wrote doesn’t give
error, but doen’t worh either. (I’m sorry I don’t understand very much
CallBacks…). I’m In RT3.8

My CustomFiled is Named “Criticite” and has 3 possible values : Critique
/ Majeure / Mineure and it is not mandatory

Here is what I add in
/opt/rt3/local/html/Callbacks/MyCallbacks/Elements/RT__Ticket/ColumnMap/ColumnMap
:

sub criticiteInColor {
my $Ticket = shift;

my $criticite = $Ticket->CustomFieldObj->Type;

my $criticite = $Ticket->CustomFieldObj->CustomFieldValues(‘3’);
my $color = undef;

if ($criticite eq ‘Critique’) {
$color = “900000”;
} elsif ($criticite eq ‘Majeure’) {
$color = “#AA8000”;
} elsif ($criticite eq ‘Mineure’) {
$color = “#000090”;
}

$criticite = loc($criticite);

if ( $Ticket->HasUnresolvedDependencies ) {
$criticite = “$criticite
}

if ($color) {
$criticite = “$criticite”
}

return “$criticite”;
}

$COLUMN_MAP->{Criticite}->{value} = &criticiteInColor;

help ?

Hi,

I would like to colorize a CustomField column in the RT at a Glance
page, as described in the ShowStatusInColor wiki page. It works well for
status, but I don’t get it for Customfield. What I wrote doesn’t give
error, but doen’t worh either. (I’m sorry I don’t understand very much
CallBacks…). I’m In RT3.8

CustomFields are handled by the entry in ColumnMap named CustomField
You’ll have to create your own version of that and use the overlay to
jam it in (or use a callback in ShowCustomField to change the color)

You can’t just use the name of the custom field in ColumnMap

-kevin