hi, i am using the following custom action preparation code i found on
the wiki. how do i do the same exact thing except for a bcc? and then
how do i create an action to notify bcc?

#uncomment Logger stuff for debuging
$RT::Logger->debug('Running Script ScriptAddCC');

my $Actor = $self->TransactionObj->Creator;
my $Corresponder_id = $self->TransactionObj->CreatorObj->PrincipalId;
my $OwnerEmail = $self->TicketObj->OwnerObj->EmailAddress();

# exit if actor is RT_SystemUser
return 1 if $Actor == $RT::SystemUser->id;

# get out if corresponder is already owner, requestor, cc or admincc.

if ( $self->TicketObj->IsWatcher( Type => 'Requestor', PrincipalId =>
$Corresponder_id)  ){
     $RT::Logger->debug("ScriptAddCC - Corresponder is Requestor, exit");
     return 1;
}

if ( $self->TicketObj->IsWatcher( Type => 'Cc', PrincipalId =>
$Corresponder_id)  ){
     $RT::Logger->debug("ScriptAddCC - Corresponder is in CC, exit");
     return 1;
}

if ( $self->TicketObj->IsWatcher( Type => 'AdminCc', PrincipalId =>
$Corresponder_id)  ){
     $RT::Logger->debug("ScriptAddCC - Corresponder is in AdminCC, exit");
     return 1;
}

if ( $self->TicketObj->IsWatcher( Type => 'Owner', PrincipalId =>
$Corresponder_id)  ){
     $RT::Logger->debug("ScriptAddCC - Corresponder is the ticket Owner, exit");
     return 1;
}

#RuslanZakirov's check
my ($status, $msg) = $self->TicketObj->AddWatcher(
     Type => "Cc",
     PrincipalId => $Corresponder_id
);

unless ( $status ) {
     $RT::Logger->error("Couldn't add watcher: $msg");
}

return 1;
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Reply via email to