[Rt-commit] rt branch, 4.0/update-subject-after-extractid, created. rt-4.0.8-153-g22099a1
Kevin Falcone
falcone at bestpractical.com
Fri Nov 9 12:44:11 EST 2012
The branch, 4.0/update-subject-after-extractid has been created
at 22099a1b5a515870be82429cd7872d4c68485a9b (commit)
- Log -----------------------------------------------------------------
commit 22099a1b5a515870be82429cd7872d4c68485a9b
Author: Tim Cutts <tjrc at sanger.ac.uk>
Date: Tue Oct 16 22:36:17 2012 +0100
Re-read Subject from Message after ExtractTicketId
Since 4.0.7, ExtractTicketId can be overridden, as in
RT::Extension::RepliesToResolved. The override might change the Subject
of the message (as the above extension does).
Keep the original subject for error messages, but if ExtractTicketId has
changed the subject, use that for the new ticket creation.
diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
index ca14e93..80b1c62 100644
--- a/lib/RT/Interface/Email.pm
+++ b/lib/RT/Interface/Email.pm
@@ -1461,6 +1461,10 @@ sub Gateway {
$args{'ticket'} ||= ExtractTicketId( $Message );
+ # ExtractTicketId may have been overridden, and edited the Subject
+ my $NewSubject = $Message->head->get('Subject');
+ chomp $NewSubject;
+
$SystemTicket = RT::Ticket->new( RT->SystemUser );
$SystemTicket->Load( $args{'ticket'} ) if ( $args{'ticket'} ) ;
if ( $SystemTicket->id ) {
@@ -1547,7 +1551,7 @@ sub Gateway {
my ( $id, $Transaction, $ErrStr ) = $Ticket->Create(
Queue => $SystemQueueObj->Id,
- Subject => $Subject,
+ Subject => $NewSubject,
Requestor => \@Requestors,
Cc => \@Cc,
MIMEObj => $Message
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list