ExtractCustomFieldValues issues

Hello,

I’ve been looking at past discussions about this plugin, and it looks
like this should have been addressed, so maybe it’s my regex. But it
seems like a pretty simple one, so…

I saw some patches for ECFV being modified to iterate thru all
attachments. Is this in the current version on CPAN? If a plaintext
email is sent to RT, the values are extracted. If an HTML attachment
is sent, the plaintext version seems to be first in the ticket, but
doesn’t seem to be checked. If i modify the regex to grab values
based on the HTML attachment, i get errors. Logs show

Jan 28 13:05:51 data RT: Committing scrip #21 on txn #55790 of ticket #10730
Jan 28 13:05:51 data RT: Use of uninitialized value in pattern match
(m//) at /opt/rt3/local/plugins/RT-Extension-ExtractCustomFieldValues/lib/RT/Action/ExtractCustomFieldValues.pm
line 44. (/opt/rt3/local/plugins/RT-Extension-ExtractCustomFieldValues/lib/RT/Action/ExtractCustomFieldValues.pm:44)
Jan 28 13:05:51 data RT: load cf Field1
Jan 28 13:05:51 data RT: load cf done: 4
Jan 28 13:05:51 data RT: look for match in Body

Line 44 is the first line in the stanza:

    if ( $Options =~ /\*/ ) {
        ProcessWildCard(
            Field       => $InspectField,
            Match       => $MatchString,
            PostEdit    => $PostEdit,
            Attachment  => $FirstAttachment,
            Queue       => $Queue,
            Ticket      => $Ticket,
            Transaction => $Transaction,
            Options     => $Options,
        );
        next;
    }

Info comes in the format

Triggertext:123456

with no spaces, and i want that 6 digit number. The HTML attachment
makes it look like

Triggertext:

123456

and i’ve tested my regex and the template, which is simply

Customfield|body|Triggertext:</td>

([0-9]{6})

That regex tests on the email body correctly when i use various
testing tools (web based, The Regex Coach, i’ve tried a bunch…). I
tried escaping all the brackets as well, no luck. Just in case i was
grabbing more than the digits, i made the custom field a text field,
not a value. Nothing. I’m out of ideas.

Making the info i need into headers isn’t an option: i have no control
over the emails i’m trying to parse. Any help is appreciated.

Rob

/chown -R us:us /yourbase

I neglected to mention that in addition to trying to match against the
HTML attachment, i originally was trying just a simple plaintext
match, which didn’t work either:

Customfield|body|Triggertext:([0-9]{6})

Seems like the Uninitialized complaint is just a warning, OK. I’m
still confused about the CFs that won’t parse: logs are acting like no
match is found, but everything i test the regex with on the email body
gets the number i want.On Wed, Jan 28, 2009 at 1:27 PM, Rob Munsch rob.munsch@gmail.com wrote:

Hello,

I’ve been looking at past discussions about this plugin, and it looks
like this should have been addressed, so maybe it’s my regex. But it
seems like a pretty simple one, so…

I saw some patches for ECFV being modified to iterate thru all
attachments. Is this in the current version on CPAN? If a plaintext
email is sent to RT, the values are extracted. If an HTML attachment
is sent, the plaintext version seems to be first in the ticket, but
doesn’t seem to be checked. If i modify the regex to grab values
based on the HTML attachment, i get errors. Logs show

Jan 28 13:05:51 data RT: Committing scrip #21 on txn #55790 of ticket #10730
Jan 28 13:05:51 data RT: Use of uninitialized value in pattern match
(m//) at /opt/rt3/local/plugins/RT-Extension-ExtractCustomFieldValues/lib/RT/Action/ExtractCustomFieldValues.pm
line 44. (/opt/rt3/local/plugins/RT-Extension-ExtractCustomFieldValues/lib/RT/Action/ExtractCustomFieldValues.pm:44)
Jan 28 13:05:51 data RT: load cf Field1
Jan 28 13:05:51 data RT: load cf done: 4
Jan 28 13:05:51 data RT: look for match in Body

Line 44 is the first line in the stanza:

   if ( $Options =~ /\*/ ) {
       ProcessWildCard(
           Field       => $InspectField,
           Match       => $MatchString,
           PostEdit    => $PostEdit,
           Attachment  => $FirstAttachment,
           Queue       => $Queue,
           Ticket      => $Ticket,
           Transaction => $Transaction,
           Options     => $Options,
       );
       next;
   }

Info comes in the format

Triggertext:123456

with no spaces, and i want that 6 digit number. The HTML attachment
makes it look like

Triggertext:123456

and i’ve tested my regex and the template, which is simply

Customfield|body|Triggertext:</td>([0-9]{6})

That regex tests on the email body correctly when i use various
testing tools (web based, The Regex Coach, i’ve tried a bunch…). I
tried escaping all the brackets as well, no luck. Just in case i was
grabbing more than the digits, i made the custom field a text field,
not a value. Nothing. I’m out of ideas.

Making the info i need into headers isn’t an option: i have no control
over the emails i’m trying to parse. Any help is appreciated.

Rob


/chown -R us:us /yourbase

/chown -R us:us /yourbase

(i think i sent this to nowhere earlier today - apologies if i didn’t).

Hello,

I’ve been looking at past discussions about this plugin, and it looks
like this should have been addressed, so maybe it’s my regex. But it
seems like a pretty simple one, so…

I saw some patches for ECFV being modified to iterate thru all
attachments. Is this in the current version on CPAN? If a plaintext
email is sent to RT, the values are extracted. If an HTML attachment
is sent, the plaintext version seems to be first in the ticket, but
doesn’t seem to be checked. If i modify the regex to grab values
based on the HTML attachment, i get nothing. Logs show:

Jan 28 13:05:51 data RT: Committing scrip #21 on txn #55790 of ticket #10730
Jan 28 13:05:51 data RT: Use of uninitialized value in pattern match
(m//) at /opt/rt3/local/plugins/RT-Extension-ExtractCustomFieldValues/lib/RT/Action/ExtractCustomFieldValues.pm
line 44. (/opt/rt3/local/plugins/RT-Extension-ExtractCustomFieldValues/lib/RT/Action/ExtractCustomFieldValues.pm:44)
Jan 28 13:05:51 data RT: load cf Field1
Jan 28 13:05:51 data RT: load cf done: 4
Jan 28 13:05:51 data RT: look for match in Body

No hits when the message comes in as HTML. When the message is sent
as plaintext, though, values are found. (And as i understand it,
that’s just a warning on the second line, yeah?)

Info comes in the format

Triggertext:123456

with no spaces, and i want that 6 digit number. The HTML attachment
makes it look like

Triggertext:

123456

and i’ve tested my regex and the template, which is simply

Customfield|body|Triggertext:</td>

([0-9]{6})

That regex tests on the email body correctly when i use various
testing tools (web based, The Regex Coach, i’ve tried a bunch…). I
tried escaping all the brackets as well, no luck. Just in case i was
grabbing more than the digits, i made the custom field a text field,
not a value. Nothing.

I also tried just a plain old
Triggertext:([0-9]{6})
trying to hit against the plaintext attachment part of the HTML mails,
but no dice.

Making the info i need into headers isn’t an option, nor is sending
all plaintext instead of the HTML: i have no control
over the emails i’m trying to parse. Any help is appreciated.

Rob

/chown -R us:us /yourbase