ExtractCustomFieldValue not working

I’ve set up the ExtractCustomFieldValue on our server and have, as far as I
know, configured the template and scrip as necessary. However, it isn’t
working. Actually, I have two for two different CFs.

This are my templates:
Environment|“Body”|CUSTOMER ENVIRONMENT\s+[(\w+)]
and
Severity|“Body”|SEVERITY\s+[([1-4]\s+-\s+.*)]

I’ve tested both regexes using an online tester and got the results I was
looking for. However, when I create a ticket with the appropriate lines within
it, nothing gets populated.

My scrips look like this:
Condition: On Create
Action: Extract Custom Field Values
Global template: ExtractEnvironment (the above template)
Stage: TransactionCreate

I don’t have any User Defined conditions or actions except the Custom action
preparation code which is simply “return 1;”. The scrip for the Severity field
is identical except for using the different template.

Anyone have an idea as to what I’m doing wrong?

Mathew
Keep up with me and what I’m up to: http://theillien.blogspot.com

I’ve set up the ExtractCustomFieldValue on our server and have, as
far as I
know, configured the template and scrip as necessary. However, it
isn’t
working. Actually, I have two for two different CFs.

This are my templates:
Environment|“Body”|CUSTOMER ENVIRONMENT\s+[(\w+)]
and
Severity|“Body”|SEVERITY\s+[([1-4]\s+-\s+.*)]

I’ve tested both regexes using an online tester and got the results
I was
looking for. However, when I create a ticket with the appropriate
lines within
it, nothing gets populated.

My scrips look like this:
Condition: On Create
Action: Extract Custom Field Values
Global template: ExtractEnvironment (the above template)
Stage: TransactionCreate

I don’t have any User Defined conditions or actions except the
Custom action
preparation code which is simply “return 1;”. The scrip for the
Severity field
is identical except for using the different template.

Anyone have an idea as to what I’m doing wrong?

When you crank up your logging to debug, what do you see?
ExtractCustomFieldValues 1.6 is quite chatty about what it is doing
and when

-kevin

After finally figuring out why I couldn’t get logging to work (I guess I hadn’t
actually tried chowning rt.log to apache:apache), I was able to get this:

[Thu May 24 08:30:11 2007] [debug]: load cf Environment
(/usr/local/rt-3.6.1//lib/RT/Action/ExtractCustomFieldValues.pm:34)
[Thu May 24 08:30:11 2007] [debug]: load cf done: 1 Fetched from cache
(/usr/local/rt-3.6.1//lib/RT/Action/ExtractCustomFieldValues.pm:40)
[Thu May 24 08:30:11 2007] [debug]: look for cf in Header “Body”
(/usr/local/rt-3.6.1//lib/RT/Action/ExtractCustomFieldValues.pm:50)
[Thu May 24 08:30:11 2007] [debug]: load cf Severity
(/usr/local/rt-3.6.1//lib/RT/Action/ExtractCustomFieldValues.pm:34)
[Thu May 24 08:30:11 2007] [debug]: load cf done: 1 Fetched from cache
(/usr/local/rt-3.6.1//lib/RT/Action/ExtractCustomFieldValues.pm:40)
[Thu May 24 08:30:11 2007] [debug]: look for cf in Header “Body”
(/usr/local/rt-3.6.1//lib/RT/Action/ExtractCustomFieldValues.pm:50)
[Thu May 24 08:30:11 2007] [debug]: About to think about scrips for transaction
#635724 (/usr/local/rt-3.6.1//lib/RT/Transaction_Overlay.pm:165)
[Thu May 24 08:30:11 2007] [debug]: About to prepare scrips for transaction
#635724 (/usr/local/rt-3.6.1//lib/RT/Transaction_Overlay.pm:169)
[Thu May 24 08:30:11 2007] [debug]: Found 2 scrips
(/usr/local/rt-3.6.1//lib/RT/Scrips_Overlay.pm:363)
[Thu May 24 08:30:11 2007] [debug]: About to commit scrips for transaction
#635724 (/usr/local/rt-3.6.1//lib/RT/Transaction_Overlay.pm:178)
[Thu May 24 08:30:11 2007] [info]: Ticket 70907 created in queue ‘CustomerCare’
by msnyder (/usr/local/rt-3.6.1//lib/RT/Ticket_Overlay.pm:755)

It appears to tell me that it has, in fact, done what I asked it to but, when I
look at the ticket, each of the CFs that I’m trying to set are still holding (no
value).

Keep up with me and what I’m up to: http://theillien.blogspot.com

Kevin Falcone wrote:

After finally figuring out why I couldn’t get logging to work (I
guess I hadn’t
actually tried chowning rt.log to apache:apache), I was able to get
this:

[Thu May 24 08:30:11 2007] [debug]: load cf Environment
(/usr/local/rt-3.6.1//lib/RT/Action/ExtractCustomFieldValues.pm:34)
[Thu May 24 08:30:11 2007] [debug]: load cf done: 1 Fetched from cache
(/usr/local/rt-3.6.1//lib/RT/Action/ExtractCustomFieldValues.pm:40)
[Thu May 24 08:30:11 2007] [debug]: look for cf in Header “Body”

The key is this log message.
“look for cf in Header “Body””
If it was looking for your data in the body of the email it just
would have
logged “look for match in Body”

It is trying to match

“Body” against the regexp /^body$/i

You don’t want the double quotes.

-kevin

Hello,

–Am 24. Mai 2007 08:06:59 -0400 schrieb Kevin Falcone
falcone@bestpractical.com:

It is trying to match

“Body” against the regexp /^body$/i

You don’t want the double quotes.

just write Body nothing else, so your example line says:

Severity|Body|SEVERITY\s+[([1-4]\s+-\s+.*)]

Regards, Dirk.
Dr. Dirk Pape (eAS - Projektleitung Campus Management)
Freie Universitaet Berlin
Grunewaldstr. 34a, 12165 Berlin
Tel. +49 (0)30 838 75143, Fax. +49 (0)30 838 54654

Yeah, I had figured that out after I figured out why I couldn’t get the
logging to work. I though I had posted about it but either it got lost
at the post office or I never actually sent it.

Thanks though :slight_smile:

Mathew

Dirk Pape wrote: