Dynamic field : location

Moderator: crythias

Locked
magicbret
Znuny newbie
Posts: 6
Joined: 09 Aug 2012, 06:44
Znuny Version: 3.1.8
Real Name: Julien

Dynamic field : location

Post by magicbret »

Hi everybody,

I am actually testing OTRS in order to replace Microsoft Dynamics (that is not a incident management system). Until now, i am very happy by the flexibility of the product.

However, i have one question. We a big customer which is located in different sites in the world. The users in this company use a cutom form, on a web portal, to complaint about the service (in fact we deliver an internet, GSM and VOIP service). On this form, they have to fill different fields (location, type of service, email address...).

How can i do to take the value in the email received and fill some dynamic fields (like location, type of service...) automatically ? Do i have to use Postmaster filters ? ACL.

It is not possible to give access to the user to the customer portal. As the users stay only few months on the sites, it will become unmanageable.

Thanks for the job you are making on this product ;-)

Cheers
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Dynamic field : location

Post by crythias »

magicbret wrote:use Postmaster filters
Or. if you can possibly do the translation to X-OTRS-fieldname fields at the collection of the form before you send it, OTRS will obey what it knows, just the same as if it sees "From" or "To" or "Subject".

Specifically, you can add these to your web form's output and OTRS and Microsoft Dynamics will (should) ignore what it doesn't know.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
magicbret
Znuny newbie
Posts: 6
Joined: 09 Aug 2012, 06:44
Znuny Version: 3.1.8
Real Name: Julien

Re: Dynamic field : location

Post by magicbret »

Thanks crythias for your quick reply.

That's a good idea and it's possible to modify the form and do that, but as i am not a developper i don't really know where to start.

The field used in the form is a dropdown list. Can i impose on your kindness to have an example of a X-OTRS field translation ?

Thanks again
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Dynamic field : location

Post by crythias »

magicbret wrote:an example of a X-OTRS field translation
Essentially, what you'd do in a PostMaster filter you'd do before it gets there.
In English: "What field do you want to map to which field in OTRS?"

For example, the web form asks for a "location". What, then, would you want to do with that information in OTRS? Do you want to assign a Queue? X-OTRS-Queue: queuenamerelatedtolocation

This can be handled in the webform logic or PostMasterFilter. If in the webform logic, there's no work to do on OTRS side. Just add the appropriate OTRS field in the header, same way as "From" or "To".

Now, as far as PostMasterFilter for dynamic fields, I'm (reasonably) certain it's possible X-OTRS-DynamicField-fieldname, though I haven't tried it, and if you want that in the dropdown list, you'll have to add it to the list in SysConfig PostmasterX-Header
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
magicbret
Znuny newbie
Posts: 6
Joined: 09 Aug 2012, 06:44
Znuny Version: 3.1.8
Real Name: Julien

Re: Dynamic field : location

Post by magicbret »

On the form, the "location" selected by the dropdown list will be assigned to a X-OTRS-DynamicField-location field.

I already do it with nagios and SystemMonitoring, where each email from nagios@example.org is assign to supervision queue, priority high, etc... And everything work as expected (and more)
magicbret
Znuny newbie
Posts: 6
Joined: 09 Aug 2012, 06:44
Znuny Version: 3.1.8
Real Name: Julien

Re: Dynamic field : location

Post by magicbret »

OK, i well advance but need a bit more help.

I have configured a postmaster filter like this :

Header 1 - From - john@example.org
Header 2 - Body - Location : New York

Action

Header 1 - X-OTRS-DynamicField-location - value : New York

This works good, i can see in the ticket created that the filed is filled

But, the value is fixed in that case. What i want, is OTRS read everything after "Location :", and the same line and put the text in the DynamicField.

I think that i should use regexp, no ?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Dynamic field : location

Post by crythias »

see that box to the left in PostMaster Filter?
To dispatch or filter incoming emails based on email headers. Matching using Regular Expressions is also possible.
If you want to match only the email address, use EMAILADDRESS:info@example.com in From, To or Cc.
If you use Regular Expressions, you also can use the matched value in () as [***] in the 'Set' action.
What's it mean?

Header 2 - Body - Location : (.*)
Action
Header 1 - X-OTRS-DynamicField-location - value: [***]

Or, of course, if you can get your webform logic to add a header and send
X-OTRS-DynamicField-location: webformlocationfieldvalue

That would be better. (You'll want to make sure the PostMaster mail account is Trusted/Yes, in order to allow X-OTRS-fields to be passed via mail).
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
magicbret
Znuny newbie
Posts: 6
Joined: 09 Aug 2012, 06:44
Znuny Version: 3.1.8
Real Name: Julien

Re: Dynamic field : location

Post by magicbret »

Great !!!

That works perfectly good.

I just need now to look how to write the php webform to add "X-OTRS-DynamicField-location" header and it will be done

Thank a lot for your help

Cheers
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Dynamic field : location

Post by crythias »

magicbret wrote:I just need now to look how to write the php webform to add "X-OTRS-DynamicField-location" header and it will be done
it should be (hopefully) *EXACTLY* the same way you specify "From" or "To" or "Subject" or "Body"
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
magicbret
Znuny newbie
Posts: 6
Joined: 09 Aug 2012, 06:44
Znuny Version: 3.1.8
Real Name: Julien

Re: Dynamic field : location

Post by magicbret »

Yes ! I found the code to include the X-OTRS filed in my webform

Code: Select all

$header .="X-OTRS-DynamicField-location:" . $_SESSION['liste1'] ."\n";
Where liste1 is the name of the location dropdown list.

So, i can switch to the next step.

Thanks, thanks and thanks a lot for your help
Locked