[rt-users] Making RT 3.8.1 grok References: and In-Reply-To:
Lars Kellogg-Stedman
lars at oddbit.com
Thu Oct 30 13:57:43 EDT 2008
This reply missed the list the first time around:
> It's something I'm of two minds about. On the one-hand, it's a really
> slick feature that makes a lot of things easier. On the other hand, it's
> quite common for users to open new tickets by popping up an old ticket
> reply and changing the subject and body. Which will incorrectly thread
> it as on the previous ticket. (Most mail clients don't expose
> "in-reply-to" and "references" headers for user editing.)
This all came about from a "hey, ticket system product A has this
feature that seems really slick, why doesn't RT do that"? So it was
more proof of concept than anything else. The fact that RT, at least
in 3.8.1, is already collecting message ids made my life much easier.
One could perhaps implement some sort of time threshold to help winnow
out this sort of thing. I don't know how other ticket systems that
use the references information as a primary source handle this.
> It'd be cool if this could become an RT extension that could be cpanned.
If I'm the only person using this code (and only in my personal RT at
the moment, not in our production system), this probably won't
percolate very high up on my to do list. If someone else wants to try
it out and verify that it works as described and spot any problems,
I'd be happy to take a look at it.
The biggest problem I see with making this an installable extension is
that it requires patching RT/Interface/Email.pm. It's a one-liner...
--- Email.pm.orig 2008-10-28 13:58:18.979900000 -0400
+++ Email.pm 2008-10-28 13:58:29.726978000 -0400
@@ -1229,6 +1229,7 @@
}
$args{'ticket'} ||= ParseTicketId( $Subject );
+ $args{'ticket'} ||= ParseReferences( $head );
$SystemTicket = RT::Ticket->new( $RT::SystemUser );
$SystemTicket->Load( $args{'ticket'} ) if ( $args{'ticket'} ) ;
...but I'm not sure where else to put it. To make this more graceful,
there would need to be a registry of some sort so that the above code
would look something like:
for my $func (@registered_functions) {
$args{'ticket'} = &$func($head) && last;
}
Or something. Maybe the MailPlugins interface could be beefed up to
do more than authentication work? If this could add arbitrary
attributes to the message object ($message->add('rt-ticket-id', ...)),
that would be a fine place to insert this sort of code. Then Email.pm
wouldn't explicitly do subject line scanning; this would be in a
MailPlugin that was enabled by default...or enabled unilaterally, or
something.
More information about the rt-users
mailing list