Mike,<br><br>If you can define that user, why not modify the email address to show the group address you want it to go to. That way the "Reply to Requestor" will work the way you want and you won't need the code?<br>
<br>Kenn<br><br><div class="gmail_quote">On Thu, Jul 5, 2012 at 1:29 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">
<div bgcolor="#FFFFFF"><div>Kenn,</div><div><br></div><div>Basically I have scanners that email scanned applications to the RT system. If the reply goes back to the scanner email address it gets dumped. So I need the reply to go back to the group that scanned the application. That is why I built the replacement routine.</div>
<div><br></div><div>It works fine at the command line, excluding the RT parts for testing. But when I save it in the RT web ui I get the error below. </div><div><br></div><div>Thanks,</div><div><br></div><div>Mike</div><div>
<br>Sent from my iPhone</div><div><div class="h5"><div><br>On Jul 5, 2012, at 4:21 PM, Kenneth Crocker <<a href="mailto:kenn.crocker@gmail.com" target="_blank">kenn.crocker@gmail.com</a>> wrote:<br><br></div><div></div>
<blockquote type="cite"><div>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>
</div></blockquote></div></div></div></blockquote></div><br>