[Rt-devel] Looking up a ticket by attachment's messageid

Jesse Vincent jesse at bestpractical.com
Tue Feb 26 17:15:18 EST 2008




On Tue, Feb 26, 2008 at 01:57:43PM -0800, Gordon Messmer wrote:
> Since the MessageId is stored in a field in the Attachments table, I 
> assume that someone thought it'd be useful to be able to search on that 
> field.  However, I don't see any API function that allows us to look up 
> an attachment by messageid, or a ticket by an associated attachment's 
> messageid.

my $a = RT::Attachment->new($RT::SystemUser);
$a->LoadByCols(MessageId => '123 at foo.com');

print $a->TransactionObj->TicketObj->id; 

or something along those lines.


> What's the easiest way to go about introducing such a function?  I 
> presume I'd create a "Tickets_Local.pm" file and create the appropriate 
> function.  Is there an existing function that can perform this query?
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
> 

-- 


More information about the Rt-devel mailing list