AutoCcOwner: Difference between revisions
Jump to navigation
Jump to search
m (3 revisions imported) |
mNo edit summary |
||
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 | |||
Condition: On Owner Change | |||
Action: User Defined | |||
Custom action preparation code | |||
<pre> | |||
my $last_id = $self->TransactionObj->NewValue; | my $last_id = $self->TransactionObj->NewValue; | ||
my $temp_user = RT::User->new(); | my $temp_user = RT::User->new(); | ||
Line 14: | Line 19: | ||
Email => $last_email); | Email => $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 20: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.