<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>Template woes...</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2 FACE="Arial">Folks,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I've been trying to set up a Template to create an approval. However once I start to get a little bit fancy it seems to stop working. When I create a Template such as this:</FONT></P>
<P><FONT SIZE=2 FACE="Arial">===Create-Ticket: ftlapproval</FONT>
<BR><FONT SIZE=2 FACE="Arial">{</FONT>
<BR><FONT SIZE=2 FACE="Arial"> my $admin;</FONT>
<BR><FONT SIZE=2 FACE="Arial"> $admin = "me@here";</FONT>
<BR><FONT SIZE=2 FACE="Arial">}</FONT>
<BR><FONT SIZE=2 FACE="Arial">Queue: OTISS-approvals</FONT>
<BR><FONT SIZE=2 FACE="Arial">Type: Approval</FONT>
<BR><FONT SIZE=2 FACE="Arial">Depended-On-By: TOP</FONT>
<BR><FONT SIZE=2 FACE="Arial">AdminCc: { $admin }</FONT>
<BR><FONT SIZE=2 FACE="Arial">Subject: Approval for ticket: {$Tickets{'TOP'}->Id} - {$Tickets{'TOP'}->Subject}</FONT>
<BR><FONT SIZE=2 FACE="Arial">Content: Your approval is requested for the</FONT>
<BR><FONT SIZE=2 FACE="Arial">ticket {$Tickets{'TOP'}->Id}: {$Tickets{'TOP'}->Subject}</FONT>
<BR><FONT SIZE=2 FACE="Arial">ENDOFCONTENT</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">It seems that "$admin" is never replaced, ie AdminCc is blank in the resulting approval ticket. So I tried using the template in the example in the manual (</FONT><A HREF="http://www.bestpractical.com/rt/docs/3.0/appendix5-approvals.txt"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://www.bestpractical.com/rt/docs/3.0/appendix5-approvals.txt</FONT></U></A><FONT SIZE=2 FACE="Arial">) and I can't get it to work either. Ie, the "@admin" array defined in the upper block does not work further down with "</FONT><FONT SIZE=2 FACE="Courier New">AdminCc: {join ("\nAdminCc: ",@admins) }</FONT><FONT SIZE=2 FACE="Courier New">".</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Of course, if I hard code the value in then it works (ie, use "AdminCc: me@here" in the body of the Template).</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Does anybody know why the variables defined in the upper block do not seem to be valid further down the Template?</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Arial">Ta muchly!</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Damien Lederer</FONT>
</P>
<BR>
</BODY>
</HTML>