Mike,<br><br>Replaces the Requestor? How? In what manner? If you just want the Requestor to have a different title or name then use the language translator. There is an array in it that lets you replace certain items when they are displayed.<br>
<br>Kenn<br><br><div class="gmail_quote">On Tue, Jul 3, 2012 at 8:02 PM, Michael Coakley <span dir="ltr"><<a href="mailto:mike.coakley@gmail.com" target="_blank">mike.coakley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm trying to write a Scrip that replaces the Requestor. When I try to save this Scrip I get a compilation error.<br>
<br>
Here is my Scrip:<br>
<br>
my %addressSubstitutions = (<br>
                "ex1\@example\.com" => "ex1location\@example\.com",<br>
                "ex2\@example\.com" => "ex2location\@example\.com"<br>
                );<br>
<br>
my $newRequestorAddr = "";<br>
<br>
my $requestorAddr = $self->TicketObj->RequestorAddresses;<br>
$RT::Logger->debug("All Queues: Requestor Email Address = $requestorAddr");<br>
<br>
foreach $testAddress (keys(%addressSubstitutions)) {<br>
                if ($requestorAddr =~ /$testAddress/i) {<br>
                                $newRequestorAddr = $addressSubstitutions{$testAddress};<br>
                                break;<br>
                }<br>
}<br>
<br>
my ($status, $msg) = $self->TicketObj->DeleteWatcher(Type => 'Requestor', Email => $requestorAddr);<br>
unless ($status) {<br>
                $RT::Logger->error("All Queues : Unable to Remove the requestor $requestorAddr : $msg");<br>
                return undef;<br>
}<br>
<br>
my ($status, $msg) = $self->TicketObj->AddWatcher(Type => 'Requestor', Email => $newRequestorAddr);<br>
unless ($status) {<br>
                $RT::Logger->error("All Queues : Unable to Add the requestor $newRequestorAddr : $msg");<br>
                return undef;<br>
}<br>
<br>
return 1;<br>
<br>
Here is the error:<br>
<br>
Couldn't compile CustomCommitCode codeblock ‘{Scrip}': Compilation error at /usr/lib/perl5/site_perl/5.14.2/Log/Dispatch/Output.pm line 39. Stack: [/usr/lib/perl5/site_perl/5.14.2/Log/Dispatch/Output.pm:39] [/usr/lib/perl5/site_perl/5.14.2/Log/Dispatch.pm:192] [/usr/lib/perl5/site_perl/5.14.2/Log/Dispatch.pm:145] [/usr/lib/perl5/site_perl/5.14.2/Log/Dispatch.pm:123] [(eval 1261):44] [/opt/rt4/share/html/Admin/Elements/EditScrip:155] [/opt/rt4/share/html/Admin/Global/Scrip.html:51] [/opt/rt4/share/html/Admin/autohandler:49] [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:548] [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:295] [/opt/rt4/share/html/autohandler:53]<br>

<br>
Thanks,<br>
<br>
Mike</blockquote></div><br>