Creating Tickets Programmatically

Hello All

I’m working on a project for a client who’s using RT.

I’m trying to create Tickets in RT programactically and stumped about how to
add a “Notes” field.

I’m able to log in to the MySQL database, insert a Ticket row and assign
data to the columns. The problem that I’m facing is that I have a few dozen
lines of text that I want to “attach” to a note that provides detailed
information for the ticket.

My client has told me to put it the Attachment table which looks good since
it’s related to the Transaction via TransactionID. However there’s no
TicketID in Transaction.

Do I populate Transaction’ObjectId with the ID of the Ticker to relate a
Transaction back to a Ticket?

Thanks in advance.
Douglas von Roeder
949.910.4084

Hello All

hi

I’m working on a project for a client who’s using RT.

I’m trying to create Tickets in RT programactically and stumped about
how to add a “Notes” field.

I’m able to log in to the MySQL database, insert a Ticket row and
assign data to the columns. The problem that I’m facing is that I
have a few dozen lines of text that I want to “attach” to a note that
provides detailed information for the ticket.

My client has told me to put it the Attachment table which looks good
since it’s related to the Transaction via TransactionID. However
there’s no TicketID in Transaction.

Do I populate Transaction’ObjectId with the ID of the Ticker to
relate a Transaction back to a Ticket?

Naive remark : why not use the REST interface ? there is a ready to use
module in CPAN. I’ve been able to use it to do a lot of stuff. While
it’s not easy to work with custom fields, adding an attachement and
doing basic changes on an RT is really easy.

Cheers,
dams

At Sunday 9/23/2007 05:21 PM, Douglas von Roeder wrote:

Hello All

I’m working on a project for a client who’s using RT.

I’m trying to create Tickets in RT programactically and stumped
about how to add a “Notes” field.

I’m able to log in to the MySQL database, insert a Ticket row and
assign data to the columns. The problem that I’m facing is that I
have a few dozen lines of text that I want to “attach” to a note
that provides detailed information for the ticket.

My client has told me to put it the Attachment table which looks
good since it’s related to the Transaction via TransactionID.
However there’s no TicketID in Transaction.

Do I populate Transaction’ObjectId with the ID of the Ticker to
relate a Transaction back to a Ticket?

Thanks in advance.

Douglas von Roeder
949.910.4084

Hello Douglas,

You’re heading for trouble if you’re trying to do this via SQL -
there are all kinds of ticket-related rows in other tables that you’d
need to know how to update correctly. You could spend a good part of
the rest of your life figuring that out from scratch. You’d be better
off using the RT Perl API, which does all this hard work for you. For
example, look in RTHOME/lib/RT/Ticket_Overlay.pm (or do a perldoc on
that file) to see how to create tickets using the API.

Good luck -
Steve


List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

Stephen Turner
Senior Programmer/Analyst - Client Support Services
MIT Information Services and Technology (IS&T)