I'm trying to automatically assign tickets whenever someone either
a) comments a ticket or alternatively,
b) responds to a ticket
The conditions are that the current owner is Nobody and the user cannot be user 'X' (my supervisor for instance, might post comments on a ticket first, but he's the boss and we want to exclude him from getting ownership.) Here's the Scrip I put together thus far. If anyone can shed some light, that'd be great!
PS: If there is a better forum for me to post this on, I'd be more than happy to not waste any of your bandwidth and go there.
Description: Ticket Auto Assign
Condition: On Comment (I'm not sure how to get On Comment AND On reply at the same time? Need two different Scrips?)
Action: User Defined
Template: Global Template: Transaction (I'm not sure what this does, need to look it up on the Wiki)
Stage: Disabled (No idea what this one does either ..)
Custom Condition:
Custom Action Preparation Code:
my $notOwner = "billybob"; # I don't want billybob to get assigned any tickets no matter if he replies first
my $Actor = $self->TransactionObj->Creator;
return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;
$RT::Logger->info("Auto assign ticket #". $self->TicketObj->id ." to user #". $Actor );
my ($status, $msg) = $self->TicketObj->SetOwner( $Actor ) unless $Actor == $notOwner;
unless ( $status ) {
$RT::Logger->error( "Impossible to assign the ticket to $Actor: $msg" );
return undef;
}
return 1;
Custom action cleanup code: return 1;
This doesn't look to do the trick. Any suggestions again, would be more than appreciated.
Thanks all!
--
Steve
_______________________________________________ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
