How to control Approval ticket routing?

Will setting the Owner in the create-ticket template route an Approval
request to the appropriate person?

The examples from the docs are mysterious (below) – who do the created
requests go to and what controls it? The examples seem incomplete –
but I’m probably missing something?

I’ve written an Approval template (also below) which retrieve the
creator’s manager from an LDAP database and creates the approval ticket
specifying the manager as owner. The tickets are created properly but
the manager isn’t notified. Also, when I click the Approval tab, I see
the Approval ticket as if it were mine, even though my manager is the
owner ???

Last question: in the QuickSearch box, the Approvals queue is 0-New,
0-Open, even though it’s really not. Is it supposed to be hidden?

Very confused.

==Create-Ticket: codereview
Depended-On-By: {$Tickets{“TOP”}->Id}
Queue: Approvals
Type: Approval
Content: Someone has created a ticket and you should approve it so they
can finish their work
ENDOFCONTENT
===Create-Ticket: two
Depends-On: {$Tickets{“approval”}->Id}
Queue: Approvals
Content-Type: text/plain
Content:
Your minion approved this ticket. you ok with that?
ENDOFCONTENT

Here’s my approval template – which seems to work except for

notification to manager ???

===Create-Ticket: approval
{
use Net::LDAP;
use Net::LDAP::Constant qw(LDAP_SUCCESS);
use constant LDAP => q(ldap.ssww.com);
use constant LDAP_PORT => q(389);
use constant LDAP_BASE => q(dc=ssww,dc=com);

get requestor’s email address

$User = new RT::CurrentUser();
$User->LoadById($Tickets{"TOP"}->Creator);
$email = $User->EmailAddress;

look up their manager

my $ldap = new Net::LDAP(LDAP, port => LDAP_PORT);
$ldap->bind;
my $filter = "mail=$email";

$mesg = $ldap->search(base => LDAP_BASE,
      filter => $filter,
      attrs => ['manager']);

if (!$mesg->code) {
  $manager=$mesg->first_entry->get_value('manager') ;
  $manager =~ s/uid=(.*?),.*/$1/;
} else {
  $manager = "Nobody";
}

}
Depended-On-By: {$Tickets{‘TOP’}->Id}
Queue: Approvals
Type: Approval
Owner: { $manager }
Content: Your approval is requested for this ticket
{$Tickets{“TOP”}->Id}: {$Tickets{“TOP”}->Subject}
ENDOFCONTENT

Carrie Coy
S&S Worldwide
(860) 537-3451 x2357