[rt-users] (no subject)
dle at sympatico.ca
dle at sympatico.ca
Wed Mar 30 14:15:41 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
More information about the rt-users
mailing list