Scrip to send email suddenly stopped working

I have a scrip working on the ‘on create’ condition and set to ‘send email’ action to our group email address, so that we are notified when a new ticket is created. It’s been working great until last Friday. All of a sudden I noticed we stopped getting these emails from RT. The only thing that changed on the system is that I added another scrip with a ‘user defined’ condition. I wasn’t sure if that condition failing would cause RT to stop processing the other scrips, so I deleted that new scrip in an attempt to fix the problem. It didn’t help.
I enabled debug logging to a file. I can see the following in the log file when I create a new ticket.

[Mon Nov 22 14:54:09 2010] [debug]: Found 6 scrips for TransactionCreate stage with applicable type(s) Create (/opt/rt3/bin/…/lib/RT/Scrips_Overlay.pm:370)
[Mon Nov 22 14:54:09 2010] [debug]: About to commit scrips for transaction #8397 (/opt/rt3/bin/…/lib/RT/Transaction_Overlay.pm:187)
[Mon Nov 22 14:54:09 2010] [debug]: Committing scrip #3 on txn #8397 of ticket #431 (/opt/rt3/bin/…/lib/RT/Scrips_Overlay.pm:190)

and I see 2 messages further down like ‘Committing scrip #x’, but it never does scrip #12, which is the one that sends an email to our group. The other odd thing is that I only have 3 scrips for ‘TransactionCreate’ stage, not 6.

Any ideas how I can further troubleshoot this?

Thanks

John Alberts
Hosted Services
Exlibris USA
john.alberts@exlibrisgroup.com

Sorry to re-post this, but I’m still completely stuck with this issue and I’m not sure how to further troubleshoot it. Anyone have any ideas?

Thanks

JohnOn 11/22/2010 08:56 AM, John Alberts wrote:

I have a scrip working on the 'on create' condition and set to 'send email' action to our group email address, so that we are notified when a new ticket is created.  It's been working great until last Friday.  All of a sudden I noticed we stopped getting these emails from RT.  The only thing that changed on the system is that I added another scrip with a 'user defined' condition.  I wasn't sure if that condition failing would cause RT to stop processing the other scrips, so I deleted that new scrip in an attempt to fix the problem.  It didn't help.
I enabled debug logging to a file.  I can see the following in the log file when I create a new ticket.

[Mon Nov 22 14:54:09 2010] [debug]: Found 6 scrips for TransactionCreate stage with applicable type(s) Create (/opt/rt3/bin/../lib/RT/Scrips_Overlay.pm:370)
[Mon Nov 22 14:54:09 2010] [debug]: About to commit scrips for transaction #8397 (/opt/rt3/bin/../lib/RT/Transaction_Overlay.pm:187)
[Mon Nov 22 14:54:09 2010] [debug]: Committing scrip #3 on txn #8397 of ticket #431 (/opt/rt3/bin/../lib/RT/Scrips_Overlay.pm:190)


and I see 2 messages further down like 'Committing scrip #x', but it never does scrip #12, which is the one that sends an email to our group.  The other odd thing is that I only have 3 scrips for 'TransactionCreate' stage, not 6.

Any ideas how I can further troubleshoot this?

Thanks


John Alberts
Hosted Services
Exlibris USA
john.alberts@exlibrisgroup.com

Sorry to re-post this, but I’m still completely stuck with this issue and I’m not sure how to
further troubleshoot it. Anyone have any ideas?

Unfortunately, you don’t say what scrips you have set up (or what
scrip 12 is). You can try this patch I wrote for something else
recently that adds extra debugging about which scrips are skipped and
let me know if it helps you identify the issue.

-kevin> On 11/22/2010 08:56 AM, John Alberts wrote:

 I have a scrip working on the 'on create' condition and set to 'send email' action to our
 group email address, so that we are notified when a new ticket is created.  It's been
 working great until last Friday.  All of a sudden I noticed we stopped getting these emails
 from RT.  The only thing that changed on the system is that I added another scrip with a
 'user defined' condition.  I wasn't sure if that condition failing would cause RT to stop
 processing the other scrips, so I deleted that new scrip in an attempt to fix the problem.
 It didn't help.
 I enabled debug logging to a file.  I can see the following in the log file when I create a
 new ticket.

 [Mon Nov 22 14:54:09 2010] [debug]: Found 6 scrips for TransactionCreate stage with
 applicable type(s) Create (/opt/rt3/bin/../lib/RT/Scrips_Overlay.pm:370)
 [Mon Nov 22 14:54:09 2010] [debug]: About to commit scrips for transaction #8397
 (/opt/rt3/bin/../lib/RT/Transaction_Overlay.pm:187)
 [Mon Nov 22 14:54:09 2010] [debug]: Committing scrip #3 on txn #8397 of ticket #431
 (/opt/rt3/bin/../lib/RT/Scrips_Overlay.pm:190)

 and I see 2 messages further down like 'Committing scrip #x', but it never does scrip #12,
 which is the one that sends an email to our group.  The other odd thing is that I only have
 3 scrips for 'TransactionCreate' stage, not 6.

 Any ideas how I can further troubleshoot this?

Kevin,
Thanks for the patch. I’ll give it a try and see if it can help me
figure out what is going on.On 11/25/2010 08:08 AM, Kevin Falcone wrote:

Unfortunately, you don’t say what scrips you have set up (or what
scrip 12 is).

Scrip 12 is the scrip I set up for the ‘oncreate’ condition that has a
’send email’ action. This is the scrip that stopped working for me that
I’m trying to troubleshoot.

John

John Alberts
Hosted Services
Exlibris USA
john.alberts@exlibrisgroup.com
cell: 1-508-878-2197

I finally figured out what the problem was. I added the following to the template for the scrip that stopped sending email.

Start Date: "{$Transaction->Starts || “(No start date given)”}"
Due Date: “$Transaction->Due || “(No due date given)”}”

Anyone know what’s wrong with this and why it would cause the scrip to stop working? I’m surprised there was nothing in the debug log about the template having a problem. That would have saved me hours of debugging.

John Alberts
Hosted Services
Exlibris USA
john.alberts@exlibrisgroup.com
cell: 1-508-878-2197

I finally figured out what the problem was. I added the
following to the template for the scrip that stopped
sending email.

Start Date: "{$Transaction->Starts || “(No start date
given)”}"
Due Date: “$Transaction->Due || “(No due date given)”}”

Hi John
might be a quick one, as there’s a missing { after Due Date: "

regards
Garry

Dr Garry Booth
IT Services
Loughborough University

Hi John
might be a quick one, as there’s a missing { after Due Date: "

Yeah, I noticed that after I posted. I added the ‘{’ and it didn’t
help. I also tried each line individually and it didn’t work. Is
’Starts’ and ‘Due’ even valid fields for $Ticket in the template? I
used perldoc on the Ticket.pm file and saw those values there.
I tried searching the wiki and also google to try and find a list of
valid objects, fields, etc that can be used in a template, but the best
I could find was this:
http://requesttracker.wikia.com/wiki/ClassObjectsMethods; and that page
doesn’t really help at all.

John Alberts
Hosted Services
Exlibris USA
john.alberts@exlibrisgroup.com
cell: 1-508-878-2197

Hi John
might be a quick one, as there’s a missing { after Due Date: "

Yeah, I noticed that after I posted. I added the ‘{’ and it didn’t
help. I also tried each line individually and it didn’t work. Is
’Starts’ and ‘Due’ even valid fields for $Ticket in the template? I

They’re valid on Ticket, but not on Template (which is what your code
did)

used perldoc on the Ticket.pm file and saw those values there.
I tried searching the wiki and also google to try and find a list of
valid objects, fields, etc that can be used in a template, but the best
I could find was this:
http://requesttracker.wikia.com/wiki/ClassObjectsMethods; and that page
doesn’t really help at all.

How about docs/templates.pod which ships with RT?

-kevin

How about docs/templates.pod which ships with RT?

Ah, I never noticed that was there in the source directory.
Unfortunately, it doesn’t really help much. It just tells me that I can
use 5 different variables, such as: $Ticket and $Transaction, but
doesn’t tell me anything about what fields (values?) that gives me
access to. Are there any other docs that might provide some insight?

John Alberts
Hosted Services
Exlibris USA
john.alberts@exlibrisgroup.com

How about docs/templates.pod which ships with RT?

Ah, I never noticed that was there in the source directory.
Unfortunately, it doesn’t really help much. It just tells me that I can
use 5 different variables, such as: $Ticket and $Transaction, but
doesn’t tell me anything about what fields (values?) that gives me
access to. Are there any other docs that might provide some insight?

You read the appropriate perldoc for each type of object.
Keep in mind that you want to also read the _Overlay.pm doc.

-kevin