Help, I've forgotten all my perl knowledge

I’m trying to write a scrip that will add a user as a 2nd requestor to
any email that comes in from a particular domain.

So I have:

Condition: On Create
Action: User Defined
Template: Global Blank
Stage: TransactionCreate

In preparation code I have:

my $requestor_address = $self->TicketObj->RequestorAddresses;
my $domain = “domain.com”;

If the user is from domain.com but NOT the manager, do the magic.

if ( $requestor_address =~ /$domain/i && $requestor_address !~
/‘manager@domain.com’/i )
{
return 1;
}
else {
return 0;
}

In action cleanup code I have:

my $Reqlist = $self->TicketObj->Requestor;

my $user = RT::User->new($RT::SystemUser);
$user->LoadByEmail(‘manager@domain.com’);

$Reqlist->AddMember($user->Id);

But it doesn’t work. What I am missing? What am I doing wrong? If
this works, will it also send an e-mail to the manager?

Basically, any request from this email domain, I want the manager to be
able to view, control, add, and stay in the loop. Is there an easier
way to do this for a non-priviledge user?

M.

Marc A. Runkel wrote:

my $Reqlist = $self->TicketObj->Requestor;

my $user = RT::User->new($RT::SystemUser);
$user->LoadByEmail(‘manager@domain.com’);

$Reqlist->AddMember($user->Id);

$self->TicketObj->AddWatcher(Type => ‘Requestor’, Email =>
‘manager@domain.com’);

Marc A. Runkel wrote:

Basically, any request from this email domain, I want the manager to be
able to view, control, add, and stay in the loop.

Create a Queue for these tickets, write a script that routes the
tickets to that queue (or route them at creation using command-line
options to RT), and make the manager a queue watcher, and give him
or her privileges on that queue as required.

For computer help, call xHELP (x4357 or 713-348-4357)
On the web: http://helpdesk.rice.edu/
Rick Russell
Helpdesk Supervisor, Client Services
IT/Academic & Research Computing
Rice University
Voice: 713.348.5267 Fax: 713.348.6099
OpenPGP/GnuPG Public Key at ldap://certificate.rice.edu
761D 1C20 6428 580F BD98 F5E5 5C8C 56CA C7CB B669