[rt-users] Scrip help to replace requestor upon create

James Price james at digitalciti.com
Mon Jun 18 16:59:55 EDT 2007

If anyone has an idea on this, essentially what I am doing now and
accomplishes what I want is the same as Bulk Update in a ticket query,
remove requestor.  Its possible from the GUI so it has to be possible via
scrip or SQL query via the API.


-----Original Message-----
From: rt-users-bounces at lists.bestpractical.com
[mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of James Price
Sent: Monday, June 18, 2007 2:06 PM
To: rt-users at lists.bestpractical.com
Subject: [rt-users] Scrip help to replace requestor upon create

I am looking to do 1 of the following:
1. Have a scrip that removes the requestor on a specific queue if it matches
X, X of course being a specific email address.

2. A SQL query that will accomplish the above that I could run from a cron

I have a MySQL query I thought would work, essentially the following:
/usr/local/mysql/bin/mysql -u dbauname rt3 -e "update Tickets set
Creator='10' where Queue='7' and Creator='2653';"

This does update the creator of a given ticket that matches userid 2653 and
changes it to userid 10, which is the nobody user.  Even though this works,
I must be missing something because there are still tickets with requestors
of the userid 2653 on the ticket and not Nobody.

An easier and more efficient way of doing this would be on creation using a
scrip.  I have a scrip which works which upon creation sets the owner
automatically.  I'm sure its just a slight modification to that scrip, but I
just can't quite find the object information I need.

My Change Owner scrip contains the following:
Condition: On Create
Action: User Defined
Template: Global template: Blank
Stage: TransactionCreate

Custom Condition: is blank
Custom action preparation code: return 1;
Custom action cleanup code: 
my $newowner = "kera";
$self->TicketObj->SetOwner( $newowner );
return 1;

I'm sure if I knew the syntax to modify this to change the requestor on a
ticket, it'd be easier.  Essentially I want the requestor to be Nobody.


James R. Price
3636 S. Iron St., Chicago, IL 60609
Company Tel: 888.855.5550
My Tel/Fax/Cell: 800.603.0769
Web: www.digitalciti.com
Email: james at digitalciti.com


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