Populating custom fields during creation from emails

We have a web form that will generate an email that will be used to create a
ticket.

I’d like to autopopulate custom fields with values from the email.

So, in the email, I might have something like $name= Brett Barnhart and I’d
like that to be put into the Name custom field.

Could someone send me an easy example of how to do this?

I searched wiki and archives where I saw this question, but no a simple
answer.

(I need more then, “Write a script to parse out the email.” I need an
example to get started)

Thanks!
Brett

There is a contributed Scrip Condition for that. See:

http://wiki.bestpractical.com/index.cgi?Contributions

it is called “OnCustomFieldValueChange”

The documentation with the package is pretty good, but basically you
create a new template which contains the information that you need,
incuding a perl regular expression to pull out the data. For
instance, I fill in three lines with this scrip. Here is the ‘code’
for them:

Contact Name|Body|(name)\s*(.)|
Contact E-Mail|Body|(email)\s
(.)|
Contact Phone|Body|(phone)\s
(.*)|

The text between the pipes is information fed to the action. The
first field is the name of the Custom Field, the second is the
location (in this case body) and the third the perl regular expression
to find the information. In this case, it looks for the text
“(name)” (without the quotes, with the parentheses) followed by a
space (\s) and then saves any thing after that. It uses the feature
of regular expressions of saving the matching text for regexps in
parentheses. The first parentheses are not saved because they are
escaped with 's.

Perl Regexps are kinda confusing if you’ve never dealt with them before.
Here’s a quick tutorial if you need it:
http://tlc.perlarchive.com/articles/perl/pm0001_perlretut.shtml

Good luck.

RandyOn Mon, 19 Jul 2004 11:52:47 -0500, Brett Barnhart brettb@hkusa.com wrote:

We have a web form that will generate an email that will be used to create a
ticket.

I’d like to autopopulate custom fields with values from the email.

So, in the email, I might have something like $name= Brett Barnhart and I’d
like that to be put into the Name custom field.

Could someone send me an easy example of how to do this?

I searched wiki and archives where I saw this question, but no a simple
answer.

(I need more then, “Write a script to parse out the email.” I need an
example to get started)

Thanks!
Brett


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com