Difference between revisions of "AutoCcOwner"

From Request Tracker Wiki
Jump to navigation Jump to search
m (3 revisions imported)
m
 
Line 3: Line 3:
This scrip adds the new owner of a ticket to the Cc list when the owner is changed. This is useful if you want all successive (including the current) owners of a ticket to see followups of tickets.
This scrip adds the new owner of a ticket to the Cc list when the owner is changed. This is useful if you want all successive (including the current) owners of a ticket to see followups of tickets.


Description: AutoCcOwner
Description: AutoCcOwner
Condition: On Owner Change
 
Action: User Defined
Condition: On Owner Change
Custom action preparation code:
 
Action: User Defined
 
Custom action preparation code
 
<pre>
   my $last_id = $self-&gt;TransactionObj-&gt;NewValue;
   my $last_id = $self-&gt;TransactionObj-&gt;NewValue;
   my $temp_user = RT::User-&gt;new();
   my $temp_user = RT::User-&gt;new();
Line 14: Line 19:
                               Email =&gt; $last_email);
                               Email =&gt; $last_email);
   return 1;
   return 1;
</pre>
   
   
  Custom action cleanup code:
  Custom action cleanup code:
   return 1;
   return 1;
  Template: Global template: Blank
  Template: Global template: Blank



Latest revision as of 21:02, 13 August 2016

AutoCcOwner

This scrip adds the new owner of a ticket to the Cc list when the owner is changed. This is useful if you want all successive (including the current) owners of a ticket to see followups of tickets.

Description: AutoCcOwner

Condition: On Owner Change

Action: User Defined

Custom action preparation code

  my $last_id = $self->TransactionObj->NewValue;
  my $temp_user = RT::User->new();
  $temp_user->Load($last_id);
  my $last_email = $temp_user->EmailAddress();
  $self->TicketObj->AddWatcher( Type => "Cc",
                              Email => $last_email);
  return 1;

Custom action cleanup code:
 return 1;
Template: Global template: Blank

You can also change the:

$self->TicketObj->AddWatcher( Type => "Cc",
                            Email => $last_email);

to:

$self->TicketObj->AddWatcher( Type => "AdminCc",
                            Email => $last_email);

to make this add the owner as AdminCc.

Update: thinking back: this is silly. You just need to make a script that notifies the current owner and use the AutoCcLastOwner to add previous owners.

-- Comment: I don't think it's silly. If you notify Owner and adminCC with separate scrips, you get multiple "Outgoing mail recorded" lines cluttering the ticket. This is nice and clean IMO.