[rt-users] On Queue Change

Todd Chapman todd at chaka.net
Tue Apr 11 16:23:51 EDT 2006


Maybe "return 1 unless" should be "return 1 if"?

-Todd

On Tue, Apr 11, 2006 at 02:13:21PM -0600, Rodney Rindels wrote:
> I have a custom scrip that were trying to get to fire on a Queue Change to
> Round Robin the owner assignment.
> 
> Description: QueueChangeHCAutoAssign
> Condition: On Queue Change
> Action: user Defined
> Template: Global Template Transaction
> Stage: Transaction Complete
> 
> Custom Condition: return 1;
> Custom Action Preperation Code: return 1;
> Custom Action Cleanup Code:
> my $QueueName = "HealthCheck/Follow-up";
> return 1 unless $self->TicketObj->QueueObj->Name eq $QueueName;
> my %hash  = (
>         '0' => 'user0',
>         '1' => 'user1',
>         '2' => 'user2',
>         '3' => 'user3',
>         '4' => 'user4',
>         '5' => 'user5',
>         '6' => 'user6',
>         '7' => 'user7');
> 
> my $user = $hash{int(rand(8))};
> 
> $RT::Logger->info("Auto assigning ticket #". $self->TicketObj->id ." to user
> $user" );
> 
> my ($status, $msg) = $self->TicketObj->SetOwner( $user );
> 
> unless( $status ) {
>   $RT::Logger->warning( "Impossible to assign the ticket to $user: $msg" );
> return undef;
> }
> 
> 1;
> 
> Looking at the log, it seems as if this Global Scrip is never firing? Is
> there a problem with the On Queue Change, or Do I have something Borked up
> here?
> 
> Thanks,
> 
> Rodney

> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
> 
> 
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
> Buy a copy at http://rtbook.bestpractical.com
> 
> 
> We're hiring! Come hack Perl for Best Practical: http://bestpractical.com/about/jobs.html



More information about the rt-users mailing list