[rt-users] Problems with Cc

Mathew Snyder jokermjs19 at comcast.net
Thu Aug 3 21:25:08 EDT 2006


Jason A. Smith wrote:
> On Wed, 2006-08-02 at 21:51, Mathew Snyder wrote: 
>> I've just got word from one of my users that we have issues with the Cc
>> on tickets.
>>
>> One issue is that when a ticket is sent in, anyone listed in the
>> original email as a Cc is not added to the ticket as a Cc.
> 
> This can be solved by setting this option in your RT_SiteConfig.pm file:
> 
> Set($ParseNewMessageForTicketCcs , 1);
> 
> To avoid problems, don't forget to set the associated reg-exp:
> 
> Set($RTAddressRegexp , '^....$');
> 
>> The other one concerns adding a Cc after the ticket has been created.
>> Sometimes, when this is done, the the email is not received by the
>> person added as a Cc.
> 
> We wanted the exact same behavior, so I looked at the RT code to see how
> it implements the above option for new ticket creation, and did the same
> for existing ticket followups.  The patch I made (attached) is for
> RT-3.4.5 and requires an additional config option to enable it:
> 
> Set($ParseFollowupMessageForTicketCcs , 1);
> 
> It modifies the RT/Interface/Email.pm module.
> 
>> Has this been seen before?  I tried doing a search through the archives
>> but that became tedious really fast.
> 
> Yes, when I was looking into this last month I did a quick search and
> found a few previous posts with the same problem:
> 
> http://lists.bestpractical.com/pipermail/rt-users/2005-June/032116.html
> 
> http://lists.bestpractical.com/pipermail/rt-devel/2006-July/008658.html
> 
> I am not saying that my patch is perfect, but it is a quick hack that
> works good enough for us.  Maybe if enough other users also find this
> useful, something similar to this patch can be included in a future
> version of RT.
> 
> ~Jason
> 
> 
> 
> ------------------------------------------------------------------------
> 
> diff -urN /usr/lib/rt/RT/Interface/Email.pm-dist /usr/lib/rt/RT/Interface/Email.pm
> --- /usr/lib/rt/RT/Interface/Email.pm-dist      2005-11-14 17:35:40.000000000 -0500
> +++ /usr/lib/rt/RT/Interface/Email.pm   2006-07-21 13:30:02.000000000 -0400
> @@ -746,6 +746,7 @@
>      my $Ticket = RT::Ticket->new($CurrentUser);
> 
>      # {{{ If we don't have a ticket Id, we're creating a new ticket
> +    my $new_ticket = 1;
>      if ( (!$SystemTicket || !$SystemTicket->Id) &&
>             grep /^(comment|correspond)$/, @actions ) {
> 
> @@ -784,6 +785,8 @@
>         $args{'ticket'} = $id;
> 
>          # }}}
> +    } else {
> +      $new_ticket = 0;
>      }
> 
>      $Ticket->Load( $args{'ticket'} );
> @@ -799,6 +802,21 @@
>          return ( 0, $message );
>      }
> 
> +    # JAS - Add Ticket CCs for followups to current tickets also:
> +    if (not $new_ticket and $RT::ParseFollowupMessageForTicketCcs) {
> +      my @Cc = ParseCcAddressesFromHead(
> +                                       Head        => $head,
> +                                       CurrentUser => $CurrentUser,
> +                                       QueueObj    => $SystemQueueObj
> +                                      );
> +      foreach (@Cc) {
> +       $Ticket->AddWatcher(
> +                           Type => 'Cc',
> +                           Email => $_,
> +                          );
> +      }
> +    }
> +
>      # }}}
>      foreach my $action( @actions ) {
>          #   If the action is comment, add a comment.

I attempted to apply the patch to v3.6.0.  I got the following rejected
hunks of code:

***************
*** 746,751 ****
      my $Ticket = RT::Ticket->new($CurrentUser);

      # {{{ If we don't have a ticket Id, we're creating a new ticket
      if ( (!$SystemTicket || !$SystemTicket->Id) &&
             grep /^(comment|correspond)$/, @actions ) {

--- 746,752 ----
      my $Ticket = RT::Ticket->new($CurrentUser);

      # {{{ If we don't have a ticket Id, we're creating a new ticket
+     my $new_ticket = 1;
      if ( (!$SystemTicket || !$SystemTicket->Id) &&
             grep /^(comment|correspond)$/, @actions ) {

Knowing not much about Perl, I'm not sure how to look at this and
attempt to fix it.


Mathew Snyder



More information about the rt-users mailing list