AutoCcOwner

From Request Tracker Wiki
Revision as of 21:02, 13 August 2016 by Tharn (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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.