[rt-users] Is it possible to do a table join in a query?

Paul Tomblin ptomblin at xcski.com
Mon Mar 26 14:04:46 EDT 2012


I would like to put a group name into a custom field, and then see only the
tickets in a certain queue where that group is a group that I belong to.  I
know how to do this from pgsql:

select t.*
from tickets t
join queues q on t.queue = q.id
join objectcustomfieldvalues ocfv on objecttype = 'RT::Ticket' and objectid
= t.id
join customfields on customfields.id = ocfv.customfield
join groups on groups.name = ocfv.content
join groupmembers on groupmembers.groupid = groups.id
where q.name = 'rtqueue1' and
customfields.name = 'group_assigned' and
groupmembers.memberid = 24 and
t.disabled = 0 and q.disabled = 0 and ocfv.disabled = 0;


but is it possible to do this sort of thing in a custom query?

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120326/53ee15ce/attachment.htm>


More information about the rt-users mailing list