[rt-users] creating export of tickets with comments

Floor Verschure rt3 at floorverschure.com
Fri May 9 07:28:57 EDT 2008


  Hello,

I am trying to make an export of all tickets in a queue using an
SQL-query. I've succeeded in creating a query including all custom
fields (see below).

In addition I also need all the comments with the tickets. Is there a  
way to do this and put them in a .csv or excell?

Greetings, Floor Verschure

////////////////////////////////////////////////////////////////////////

   SELECT t.id, t.subject, t.priority, t.created, t.status,
t.resolved, c37.content AS 'Eneco Ref. Nr.',c40.content AS 'Aspective
Ref. Nr.' , c38.content AS 'Downtime',c39.content AS 'Workaround'

FROM Tickets t

LEFT JOIN TicketCustomFieldValues c38 ON (t.id = c38.ticket AND
c38.customfield = 38)
LEFT JOIN TicketCustomFieldValues c37 ON (t.id = c37.ticket AND
c37.customfield = 37)
LEFT JOIN TicketCustomFieldValues c39 ON (t.id = c39.ticket AND
c39.customfield = 39)
LEFT JOIN TicketCustomFieldValues c40 ON (t.id = c40.ticket AND
c40.customfield = 40)

WHERE t.Queue=44

///////////////////////////////////////////////////////////////////////




More information about the rt-users mailing list