[rt-users] Which table entry holds requestor info?

Mike Patterson mikep at uclink.berkeley.edu
Tue Feb 8 19:41:20 EST 2005


I need to find a way to match the Users table to the Tickets table based 
on the Requestor.

Currently I've got a nightly cronjob which compares people's email 
addresses to our ldap server and updates their department in RT (using 
Users.Organzation field).

I do this so that I can use this with a php page that shows tickets 
submitted by department.  A simplified version of my mysql statement:
SELECT Tickets.id, Users.Organization
	FROM Tickets, Users
  	WHERE Tickets.Creator = Users.id;

This works fairly well except for when IT staff create tickets for 
people.  Because this associates their Users.Id with Tickets.Creator. 
This makes my tables associate tickets and departments by who created 
it, not by who the requestor/s are.

I need a way to show this information based on who the Requestors 
Organization (dept) is.  When I browse around the tables, it isn't clear 
to me where the Users.id of the Requestor is stored.

When I look at Transactions I see some info like this (so the new user 
is Users.id=10428):
  id  	 Ticket   	 Type  	        Field  	 NewValue
64460 	3026 	        AddWatcher 	Requestor   10428

But I'm not sure how to link it all up.  So I guess what I'm looking for 
is where the Requestor/s data is stored and how I can match a Ticket.id 
to the Users.id of the Requestor.

Any ideas?

Thanks,
Mike



More information about the rt-users mailing list