[rt-users] Template won't fire when scrip condition is true
Kenneth Crocker
KFCrocker at lbl.gov
Tue Apr 17 14:32:58 EDT 2007
Gene,
I'm certainly no expert, but usually it's the simple assumed things
that bite us. You're stated
"Since the returned value ($val) is 1, the Acknowledge template should
get run, but it doesn't. I'm certain of this because the first line of
the template is:
{ $RT::Logger->debug("Template DNS:26 (Acknowledge): Entering template");
and nothing gets logged."
It looks to me like you're missing a right parenthesis, but maybe you
only showed part of the code. Just a thought.
Kenn
LBNL
Gene LeDuc wrote:
> Hi All,
>
> I've been scratching my head over this for 2 days and haven't been able
> to solve it. I have a scrip that is not firing the Notify Others action
> when its user-defined condition is true. The scrip fires, the condition
> is true, but the execution chain simply ends without the template
> getting launched. There are no errors in the apache log and my debug
> log shows that the scrip condition is true. I have an almost identical
> scrip (different code for conditional and template) in another queue
> that is working fine, so I'm taking a step back and asking if anyone
> here can see my mistakes.
>
> 1. An e-mail is sent to RT and data is extracted from it and loaded into
> custom fields in the newly created ticket. This is working; the ticket
> gets created and all of the custom fields get their correct data.
> 2. Setting one of the custom fields (above) causes a user-defined
> condition in another scrip to fire. The scrip looks like this:
> Description: Ack Requestor
> Condition: User Defined
> { ### True when machine name is first set (set by New Ticket scrip)
> my $MyName = "Scrip DNS:37:Condition (Ack Requestor)";
> my $Transaction = $self->TransactionObj;
> my $field = 7;
> my $val = ($Transaction->Type =~ /CustomField/i) &&
> ($Transaction->Field == $field) && !$Transaction->OldValue();
> $RT::Logger->debug("$MyName: Conditional is $val");
> return $val;
> }
> Action: Notify Other Recipients
> Template: Acknowledge
> Stage: TransactionCreate
>
> I know that the scrip is firing because of the $RT::Logger->debug
> statement (just before the return in the condition code), and I know
> that the return value is 1 for the same reason. Here is the log entry:
> [Tue Apr 17 17:40:56 2007] [debug]: Scrip DNS:37:Condition (Ack
> Requestor): Conditional is 1 ((eval 900):8)
>
> Since the returned value ($val) is 1, the Acknowledge template should
> get run, but it doesn't. I'm certain of this because the first line of
> the template is:
> { $RT::Logger->debug("Template DNS:26 (Acknowledge): Entering template");
> and nothing gets logged.
>
> Here is the debug log for this run (Transaction 3237 is the ticket
> creation and 3238 is the custom field being populated):
> [Tue Apr 17 17:40:54 2007] [debug]: About to think about scrips for
> transaction #3233 (/opt/local/lib/RT/Transaction_Overlay.pm:165)
> [Tue Apr 17 17:40:54 2007] [debug]: About to think about scrips for
> transaction #3234 (/opt/local/lib/RT/Transaction_Overlay.pm:165)
> [Tue Apr 17 17:40:54 2007] [debug]: About to think about scrips for
> transaction #3235 (/opt/local/lib/RT/Transaction_Overlay.pm:165)
> [Tue Apr 17 17:40:54 2007] [debug]: About to think about scrips for
> transaction #3236 (/opt/local/lib/RT/Transaction_Overlay.pm:165)
> [Tue Apr 17 17:40:54 2007] [debug]: About to think about scrips for
> transaction #3237 (/opt/local/lib/RT/Transaction_Overlay.pm:165)
> [Tue Apr 17 17:40:54 2007] [debug]: About to prepare scrips for
> transaction #3237 (/opt/local/lib/RT/Transaction_Overlay.pm:169)
> [Tue Apr 17 17:40:54 2007] [debug]: Found 4 scrips
> (/opt/local/lib/RT/Scrips_Overlay.pm:363)
> [Tue Apr 17 17:40:54 2007] [debug]: Scrip DNS:37:Condition (Ack
> Requestor): Conditional is ((eval 890):8)
> [Tue Apr 17 17:40:54 2007] [debug]: About to commit scrips for
> transaction #3237 (/opt/local/lib/RT/Transaction_Overlay.pm:178)
> [Tue Apr 17 17:40:56 2007] [debug]: About to think about scrips for
> transaction #3238 (/opt/local/lib/RT/Transaction_Overlay.pm:165)
> [Tue Apr 17 17:40:56 2007] [debug]: About to prepare scrips for
> transaction #3238 (/opt/local/lib/RT/Transaction_Overlay.pm:169)
> [Tue Apr 17 17:40:56 2007] [debug]: Found 3 scrips
> (/opt/local/lib/RT/Scrips_Overlay.pm:363)
> [Tue Apr 17 17:40:56 2007] [debug]: Scrip DNS:37:Condition (Ack
> Requestor): Conditional is 1 ((eval 900):8)
> [Tue Apr 17 17:40:56 2007] [debug]: About to commit scrips for
> transaction #3238 (/opt/local/lib/RT/Transaction_Overlay.pm:178)
> [Tue Apr 17 17:40:56 2007] [info]: Ticket 313 created in queue 'DNS' by
> bogus.user at bogus.domain.com (/opt/local/lib/RT/Ticket_Overlay.pm:754)
> [Tue Apr 17 17:40:57 2007] [debug]: Found 0 scrips
> (/opt/local/lib/RT/Scrips_Overlay.pm:363)
>
>
> Can someone point out what I'm missing here?
>
> Thanks,
> Gene
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy
> a copy at http://rtbook.bestpractical.com
>
More information about the rt-users
mailing list