[rt-users] Change owner on Q change

Joshua Colson jcolson at voidgate.org
Thu May 25 19:32:16 EDT 2006


On Thu, 2006-05-25 at 16:06 -0700, Kenneth Crocker wrote:
> To all,
> 
>     I hope this gets in, I've tried before and I do not get recognised. 
> I have been trying to create a scrip to cause the owner to change to 
> "nobody" when the Queue is changed. I have also created a new status 
> that I use as a condition. The following is the code:
> 
> # ---  This code sets the owner to nobody for the new queue    -----       #
> $RT::Logger->debug("trying to set owner");
> #my ($code, $msg) = $self->TicketObj->SetOwner(10, 'Force');
> $self->TicketObj->_Set(Field => 'Owner', Value => 10);
> #$RT::Logger->debug("set owner: $code: $msg");
> #--------------------------------------------------------------------------#

I'm certainly not an RT expert but I see a couple of problems off hand:

#========================================================
$RT::Logger->debug("trying to set owner");
my $nobody = RT::User->new($RT::SystemUser);
$nobody->Load(10);

$self->TicketObj->SetOwner($nobody);
# By convention, method names that start with _ are private and should
#  not be called directly.
#========================================================

That code is completely untested, but it may get you going in the right
direction.

-- 
Joshua Colson <jcolson at voidgate.org>




More information about the rt-users mailing list