Thank you Jeff, works perfect, I forgot that "==" is used only for numbers, not strings...<br><br>Ivan<br><br><div class="gmail_quote">2010/5/3 Jeff Voskamp <span dir="ltr"><<a href="mailto:javoskam@uwaterloo.ca">javoskam@uwaterloo.ca</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On 05/03/2010 11:49 AM, Givano wrote:<br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
Hi,<br>
<br>
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.<br>
<br>
########################<br>
Subject: new ticket, 30 minutes unowned!<br>
RT-Send-Cc: { my $values = $Ticket->CustomFieldValues('CIT_Category');<br>
my $OUTPUT;<br>
my $CFValue;<br>
while ( my $value = $values->Next ) {<br>
$CFValue = $value->Content;<br></div>
if ($CFValue == 'IT Facilites') { $OUTPUT = '<a href="mailto:user1@dom.com" target="_blank">user1@dom.com</a> <mailto:<a href="mailto:user1@dom.com" target="_blank">user1@dom.com</a>>, <a href="mailto:user2@dom.com" target="_blank">user2@dom.com</a> <mailto:<a href="mailto:user2@dom.com" target="_blank">user2@dom.com</a>>' }<br>
elsif ($CFValue == 'Linux/Network') { $OUTPUT = '<a href="mailto:user3@dom.com" target="_blank">user3@dom.com</a> <mailto:<a href="mailto:user3@dom.com" target="_blank">user3@dom.com</a>>, <a href="mailto:user4@dom.com" target="_blank">user4@dom.com</a> <mailto:<a href="mailto:user4@dom.com" target="_blank">user4@dom.com</a>>' }<br>
elsif ($CFValue == 'Phone') { $OUTPUT = '<a href="mailto:user5@dom.com" target="_blank">user5@dom.com</a> <mailto:<a href="mailto:user5@dom.com" target="_blank">user5@dom.com</a>>, <a href="mailto:user6@dom.com" target="_blank">user6@dom.com</a> <mailto:<a href="mailto:user6@dom.com" target="_blank">user6@dom.com</a>>' }<br>
elsif ($CFValue == 'Windows') { $OUTPUT = '<a href="mailto:user7@dom.com" target="_blank">user7@dom.com</a> <mailto:<a href="mailto:user7@dom.com" target="_blank">user7@dom.com</a>>, <a href="mailto:user8@dom.com" target="_blank">user8@dom.com</a> <mailto:<a href="mailto:user8@dom.com" target="_blank">user8@dom.com</a>>' }<div class="im">
<br>
}<br>
$OUTPUT;<br>
}<br>
<br>
The ticket {$Ticket->id} stayed unowned for 30 minutes.<br>
<br>
Please do a categorisation, assign optionally an owner!<br>
######################################<br>
</div></blockquote>
Try using 'eq' instead of '==' - you want to compare the values of the string, not if it's set.<br>
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.<br><font color="#888888">
<br>
Jeff<br>
</font></blockquote></div><br>