How to write a query to select all Correspondence Added Tickets

We are currently researching a way to pull all tickets that had
Correspondence Added to them over a given time frame. Does anyone have
a query that we can use to do this?

Regards,

Marco A Moreno

We are currently researching a way to pull all tickets that had
Correspondence Added to them over a given time frame. Does anyone have
a query that we can use to do this?

I don’t think you can do it with the search interface. You
can search for tickets that have been updated in some
time frame, but that would include custom fields changes, etc.

What you might do is create a scrip that set’s a custom field
with a timestamp on every correspondence and then query on
that CF.

-Todd

I should have clarified, i would like to query this directly against the
database but I don’t know how the associations between a ticket and its
history are stored that reflect the Correspondence Added section of the
history.

Thanks.From: Todd Chapman [mailto:todd@chaka.net]
Sent: Wednesday, March 01, 2006 1:42 PM
To: Marco Moreno
Cc: rt-devel@lists.bestpractical.com
Subject: Re: [Rt-devel] How to write a query to select all
Correspondence Added Tickets

I should have clarified, i would like to query this directly against the
database but I don’t know how the associations between a ticket and its
history are stored that reflect the Correspondence Added section of the
history.

Thanks.

I recommend you use the Perl API. But if you insist on SQL
you will need to join Tickets and Transactions. The fields
of interest are Transactions.Type = ‘Correspondence’ and
Transactions.Created > ‘something’

-Todd