[rt-users] Default Ticket Owner?

Nathan Oyler noyler at khimetrics.com
Thu Dec 15 09:56:59 EST 2005


> > You could modify a queue-specific scrip to do this.  I
> > believe examples are in the wiki under Contributions.
> 
> Thank you. I'll have another look - I ended up adding a --queue option
> to rt-mailgate, and updaing the ncessary to process it ... But it
would
> be nice to do it in a more maintainable manner.
> 

I think I may have found it on the wiki or mailing list, but since I
have it right here...


Create a new scrip for that queue as follows:

Condition: OnCreate
Action: User Defined
Template: Global template: Blank
Stage: Transaction Create
Custom Condition:
Custom action prep. code: return 1;
Custom action cleanup code:

# get actor ID
my $User = new RT::User($RT::SystemUser);


# Put the email address of the user who needs to own tickets in this

queue in here!

$User->LoadByEmail("user\@domain.tld");


my $Actor = $User->id;


# if actor is RT_SystemUser then get out of here
return 1 if $Actor == $RT::SystemUser->id;


# get out unless ticket owner is nobody
return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;


# ok, try to change owner
$RT::Logger->info("Auto assign ticket #". $self->TicketObj->id ." to

user #". $Actor );

my ($status, $msg) = $self->TicketObj->SetOwner( $Actor );
unless( $status ) {
$RT::Logger->warning( "Impossible to assign tickt to $Actor: $msg"

);

return undef;
}
return 1;



More information about the rt-users mailing list