[BNM] RT SQL

Jason Bailey j.bailey at sussex.ac.uk
Tue Apr 17 15:19:41 BST 2007


Hello,
Please can you CC me in the reply as I'm a digest/web reader and both the 
BNM archive and google archive don't seem to be updating; could be me.

We use RT (request tracker) at work but I don't have access to the source. 
Does anyone use it and would be willing to send me the sql which displays 
the History of the ticket. Not really after basics/metadata. I could 
download the source but am on a locked down PC which doesn't allow me to 
read gzipped files. I can try at home later, if not.

I'm currently using the following SQL (which I nicked from someone but it 
is slow). He may be reading this so sorry if you are just trying to speed 
things up a bit.

SELECT	DISTINCT Attachments.Content,
								Transactions.id,
								Transactions.Created,
								Transactions.Creator,
								Users.RealName		
						FROM	Transactions, Users, Attachments
						WHERE	Attachments.TransactionId=Transactions.id
						AND		Transactions.Creator=Users.id
						AND		Transactions.ObjectId=$id // ***the ticket id
						AND		Users.RealName<>'The RT System itself'
						GROUP BY Attachments.Content
						ORDER BY Transactions.Created";

// where $id is supplied in the http post to the page

I suspect the distinct and group by are probably not helping but I'm not 
really sure of the structure of the ticket history etc and therefore 
optimising might be a bit of hit-and-miss.

Thanks
Jason



More information about the BNMlist mailing list. Powered by Wessex Networks