Template woes

Folks,

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:

===Create-Ticket: ftlapproval
{
my $admin;
$admin = “me@here”;
}
Queue: OTISS-approvals
Type: Approval
Depended-On-By: TOP
AdminCc: { $admin }
{$Tickets{‘TOP’}->Subject}
Content: Your approval is requested for the
ticket {$Tickets{‘TOP’}->Id}: {$Tickets{‘TOP’}->Subject}
ENDOFCONTENT

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 (http://www.bestpractical.com/rt/docs/3.0/appendix5-approvals.txt
http://www.bestpractical.com/rt/docs/3.0/appendix5-approvals.txt ) and I
can’t get it to work either. Ie, the “@admin” array defined in the upper
block does not work further down with “AdminCc: {join (”\nAdminCc:
",@admins) }".

Of course, if I hard code the value in then it works (ie, use “AdminCc:
me@here” in the body of the Template).

Does anybody know why the variables defined in the upper block do not seem
to be valid further down the Template?

Ta muchly!

Damien Lederer

Lederer, Damien wrote:

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:

AdminCc: { $admin }

Try one of the following, depending on your intent:

AdminCc: {$Ticket->AdminCcAddresses}
AdminCc: {$Tickets{‘TOP’}->AdminCcAddresses}
�|� Request Tracker — Best Practical Solutions – Trouble Ticketing. Free.

Try one of the following, depending on your intent:

AdminCc: {$Ticket->AdminCcAddresses}
AdminCc: {$Tickets{‘TOP’}->AdminCcAddresses}

Actually, I’m pulling the address from an external source. I just dropped
that part of the code to make it easier to read (of course, the AdminCc is
verified as a valid RT user).

The workflow surrounding this ticket dictates that it be passed for approval
through many different people at various stages. These approvers only need
to be notified when the ticket comes within their scope of the workflow.
Therefore I don’t want to add them ALL as AdminCc’s of the original
ticket… only for the approval.

The example template in the manual suggested that I could pass variables
from the first block through to subsequent blocks in the body of the
template. But I just can’t seem to get that to work :frowning: