[Rt-devel] getting ticket content from another perl script while ticket is being saved/updated

Vipin Hegde VHegde at myers.com
Thu Oct 27 15:21:34 EDT 2005


With a lot of help from Joby, I've setup a scrip which calls a
custom-built perl script whenever a Ticket gets created/updated. That
call seems to work fine; the only problem is that when I create a ticket
(using the web interface of RT), which in turn kicks off the call to the
scrip; the perl script that's called by the script cannot find the
ticket data in the mysql database; it's looks as if both the data
updation as well as the call to the perl script are wrapped up in one
single transaction, which is preventing the perl script's "select SQL "
from seeing the data that's just been inserted into the database. If I
run the same SELECT stmt a couple of seconds after the ticket's created
(or if I run my perl script manually a second or so after the ticket's
created), the SQL runs fine . 

Here's the SQL stmt:
select
  a.content,
  t.type
from 
  Transactions t,
  Attachments a
where
  t.id = a.TransactionId and
  t.id = $tran_id


where $tran_id is the Transaction ID which is being passed by the Scrip,
which I've setup in RT. Here's the scrip code:

========================================================================
====my $ticket = $self->TicketObj->Id;
my $tran_id = $self->TransactionObj->Id;

`/www/cgi-bin/test.pl --ticket_id=$ticket --tran_id=$tran_id`;

========================================================================
====


So my question is, is there a way to get the ticket content from my
custom script when it's called from the Scrip?

Regards,
Vipin




More information about the Rt-devel mailing list