[rt-users] SetOwner chemistry
Konstantin Naryzhniy
konstantinn at parallels.com
Mon Apr 30 10:49:10 EDT 2007
Jesse!
Thank you very much, sir! It's all clear now.
Sorry if my question sounded like I haven't searched the wiki and the lists
before asking=)
Stan
-----Original Message-----
From: Jesse Vincent [mailto:jesse at bestpractical.com]
Sent: Monday, April 30, 2007 6:42 PM
To: Konstantin Naryzhniy
Cc: rt-users at lists.bestpractical.com
Subject: Re: [rt-users] SetOwner chemistry
On Apr 30, 2007, at 10:23 AM, Konstantin Naryzhniy wrote:
> Hello!
>
> RT 3.6.1
>
> Could anyone predict the results of setting ticket's owner manually
> through
> simple SQL query:
>
> update Tickets set Owner = 123456 where id = 654321; ?
>
> I know that there are several tables updated in SetOwner method and
> I am
> interested what consequences such "brutal" workaround may cause.
> So far I've tested this query and it looks fine for ticket updating
> and
> resolving.
>
> If using this query multiple time eventually can trigger RT failure I
> wouldn't want to use it.
Using it even once will hurt you, alas.
> Also, I would appreciate it very much if you could provide me with
> the list
> of tables updated during SetOwner.
>
> The reason I don't favor using SetOwner is that I do not know how
> to=) I'm
> trying to write a custom auto ticket assingment perl-module that
> should be
> put in crontab and I've just no idea how to utilize RT lib in there.
There should be some samples on the wiki to help you out, but this
(untested) code may do what you mean:
#!/usr/bin/perl
use warnings;
use strict;
use lib '/opt/rt3/lib';
use RT;
RT::LoadConfig;
RT::Init;
use RT::Ticket;
use RT::User;
my $user = RT::User->new($RT::SystemUser);
$user->LoadByCols(Name => 'root');
my $ticket = RT::Ticket->new($RT::SystemUser);
$ticket->Load(1234);
my ($val,$msg) = $ticket->SetOwner($user->id);
print $msg;
> Seriosly, I'm no programmer))
>
> Any help and advice appreciated,
>
> Sincerely,
> Stan
>
> _______________________________________________
> 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
>
More information about the rt-users
mailing list