[rt-users] Scrip for Default Owners

Dave Edwards dle at sympatico.ca
Wed Mar 30 13:52:10 EST 2005


I'm working on a scrip that I hope will allow new tickets to be
assigned to a default owner per queue.  What I have so far is not
causing trouble, but neither is it working -- the owner remains
Nobody.  Here it is. (On Create, User Defined with template
Transaction.)

# Custom action preparation code
return 1;

# Custom action cleanup code
my $ticket = $self->TicketObj;

my $ticketsQueue = $ticket->QueueObj->id;

# map the numeric IDs of each Queue to a default owner
my %defaultOwners = (
                   # Queue   => user                   
   '3' => '22',    # Foo     => bob
   '4' => '26',    # Bar     => carole
   '5' => '28',    # Fud     => ted
   '1' => '10',    # General => alice
);

# if owner of this new ticket is Nobody
if ($ticket->Owner eq '10') {
    # change the owner from Nobody to default for this queue
    $ticket->SetOwner($defaultOwners[$ticketsQueue]);
    return 1;
}
else {
    return undef;
}
-----

What have I done wrong here?

Thanks,
Dave.
-- 
Dave Edwards <dle&sympatico,ca>
Freelance and Technical Writer,
With Special Interest in Open Source Software
http://bigStory.homelinux.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20050330/aa70b5ff/attachment.sig>


More information about the rt-users mailing list