[rt-users] in sql how do you get to custom fields?

Lander, Scott slander at hearstsc.com
Tue Jun 19 17:31:03 EDT 2012


I am using a 3rd party BI tool for some auditing tools here, and am trying to understand the table layout.

As part of the project I would like to list for a ticket the

Ticket number, creator, creator phone number, created date, ....the queue, the business unit, and other data.

I have figured out how to join the data from tickets, queues, and users tables, but I am not getting very far on the custom fields.   In my example above,  I have a custom field "Business Unit" and it has several different potential values.    Can anyone suggest how I might add that to my query?

Currently I have:

select Tickets.id, Tickets.Status, Tickets.Subject,
Tickets.Created,tickets_creator_user.Name as "Creator",
Tickets.Started,tickets_owner_users.Name as "Owner",
Tickets.Resolved,  tickets_lastupdateby_users.Name as "Last Update By",
Queues.Name as "Queue"
from Tickets,
Users tickets_creator_user,
Users tickets_owner_users,
Users tickets_lastupdateby_users,
Queues
where Queues.id = Tickets.Queue and
Tickets.Creator = tickets_creator_user.id and
Tickets.Owner = tickets_owner_users.id and
Tickets.LastUpdatedBy = tickets_lastupdateby_users.id;

Thanks

Scott

------------------------------------------------------------------------------------
This e-mail message is intended only for the personal use of the recipient(s) named above. If you are not an intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the Hearst Service Center (cadmin at hearstsc.com) immediately by email and delete the original message.
------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120619/fee43aba/attachment.htm>


More information about the rt-users mailing list