Thank you Jeff, works perfect, I forgot that "==" is used only for numbers,
not strings...

Ivan

2010/5/3 Jeff Voskamp <[email protected]>

> On 05/03/2010 11:49 AM, Givano wrote:
>
>> Hi,
>>
>> I'm trying to send an email from template, initiated by rt-crontool as
>> described in wiki, the only trick is that dependent on custom field it
>> should be sent to other persons group. Here my template, somehow it always
>> send to user1 and user 2.
>>
>> ########################
>> Subject: new ticket, 30 minutes unowned!
>> RT-Send-Cc: { my $values = $Ticket->CustomFieldValues('CIT_Category');
>>  my $OUTPUT;
>>  my $CFValue;
>>  while ( my $value = $values->Next ) {
>>    $CFValue = $value->Content;
>>    if ($CFValue == 'IT Facilites') { $OUTPUT = '[email protected] <mailto:
>> [email protected]>, [email protected] <mailto:[email protected]>' }
>>    elsif ($CFValue == 'Linux/Network') { $OUTPUT =  '[email protected]<mailto:
>> [email protected]>, [email protected] <mailto:[email protected]>' }
>>    elsif ($CFValue == 'Phone') { $OUTPUT =  '[email protected] <mailto:
>> [email protected]>, [email protected] <mailto:[email protected]>' }
>>    elsif ($CFValue == 'Windows') { $OUTPUT =  '[email protected] <mailto:
>> [email protected]>, [email protected] <mailto:[email protected]>' }
>>
>>  }
>>  $OUTPUT;
>> }
>>
>> The ticket {$Ticket->id} stayed unowned for 30 minutes.
>>
>> Please do a categorisation, assign optionally an owner!
>> ######################################
>>
> Try using 'eq' instead of '==' - you want to compare the values of the
> string, not if it's set.
> You might also want to use '.=' instead of '=' for $OUTPUT if you are
> handling multiple values for CIT_Category, but watch out for missing commas.
>
> Jeff
>
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Reply via email to