Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Devel

Looking up a ticket by attachment's messageid

 

 

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded


yinyang at eburg

Feb 26, 2008, 1:57 PM

Post #1 of 5 (533 views)
Permalink
Looking up a ticket by attachment's messageid

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.

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


jesse at bestpractical

Feb 26, 2008, 2:15 PM

Post #2 of 5 (506 views)
Permalink
Re: Looking up a ticket by attachment's messageid [In reply to]

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
>

--
_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


yinyang at eburg

Feb 26, 2008, 5:29 PM

Post #3 of 5 (509 views)
Permalink
Re: Looking up a ticket by attachment's messageid [In reply to]

Jesse Vincent wrote:
>
> my $a = RT::Attachment->new($RT::SystemUser);
> $a->LoadByCols(MessageId => '123[at]foo.com');
>
> print $a->TransactionObj->TicketObj->id;
>
> or something along those lines.

Yeah, that's perfect.

I wanted to be able to track issues with RT3, but not use RT3 as a
gateway between support staff and customers. Instead, I just want it to
get a copy of messages and sort them into tickets as appropriate,
which means that the subject won't ever have ticket numbers in them.
The attached patch seems to do what I want.
Attachments: reference.patch (1.04 KB)


sam at rfc1149

Feb 27, 2008, 10:14 AM

Post #4 of 5 (500 views)
Permalink
Re: Looking up a ticket by attachment's messageid [In reply to]

>>>>> "Gordon" == Gordon Messmer <yinyang[at]eburg.com> writes:

Gordon> I wanted to be able to track issues with RT3, but not use RT3
Gordon> as a gateway between support staff and customers. Instead, I
Gordon> just want it to get a copy of messages and sort them into
Gordon> tickets as appropriate, which means that the subject won't
Gordon> ever have ticket numbers in them. The attached patch seems to
Gordon> do what I want.

Thanks, this is great!

You might also want to look at the In-Reply-To header, some old MUA do
not use the References: header for email (this header comes from
Usenet if my memory serves well).

Sam
--
Samuel Tardieu -- sam[at]rfc1149.net -- http://www.rfc1149.net/

_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


pere at hungry

Feb 27, 2008, 10:55 PM

Post #5 of 5 (495 views)
Permalink
Re: Looking up a ticket by attachment's messageid [In reply to]

An old patch to do what you want is available from
<URL:http://www.usit.uio.no/it/rt/modifications/> under the title "Use
References and In-Reply-to of incoming emails to find ticket ID"

Happy hacking,
--
Petter Reinholdtsen
_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.