[rt-users] ExtractCustomFieldValues issues

Rob Munsch rob.munsch at gmail.com
Wed Jan 28 13:27:09 EST 2009


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:</td><td>123456

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

Customfield|body|Triggertext:<\/td><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



More information about the rt-users mailing list