PostMaster filter copy specific values from Subject to “Set value”

Moderator: crythias

Locked
PiotrIr
Znuny newbie
Posts: 25
Joined: 02 Sep 2015, 17:37
Znuny Version: 4 Patch Level 11

PostMaster filter copy specific values from Subject to “Set value”

Post by PiotrIr »

Hi,
Probably this is dummy question but I wasn’t able to find clear answer. I would like to log calls using e-mail and filter them as follow

Filter condition
* First value in Subject
* Second value in Subject

Set E-Mail Header
* X-OTRS-CustomerNo First value in Subject
* X-OTRS-DunamicField-DF Second value in Subject

Could somebody advise me how to do this? I can mark somehow those values in Subject if this helps but I wasn’t able to find the way to copy values
EXG133
Znuny expert
Posts: 217
Joined: 06 Aug 2012, 18:12
Znuny Version: 3.1.7 & 4.04

Re: PostMaster filter copy specific values from Subject to “Set value”

Post by EXG133 »

In the default Postmaster filter you can use ONE value with a capture group:

Filter:

Subject: (?i)Example#({7d})

Email Header:

X-OTRS-DynamicFieldExampleNumber: [***]

This will capture the 7 digits between ( )
[***] is the syntax to fill in the values of the capture group.

If you need to capture more than one value you need to write your own postmaster module
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: PostMaster filter copy specific values from Subject to “Set value”

Post by reneeb »

@EXG133: Therefor http://opar.perl-services.de/package/R/ ... sterFilter exists (maybe this will be integrated in OTRS6)
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
PiotrIr
Znuny newbie
Posts: 25
Joined: 02 Sep 2015, 17:37
Znuny Version: 4 Patch Level 11

Re: PostMaster filter copy specific values from Subject to “Set value”

Post by PiotrIr »

Thanks a lot, this explains why I had problems!
One more question if you mind, if I would like to set subject like that
Subject: First_value Second_value (space between them if possible if not I can use any reasonable char)
What expression should I have for first filter and for second if I don’t know length of those values?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: PostMaster filter copy specific values from Subject to “Set value”

Post by crythias »

PiotrIr wrote:Subject: First_value Second_value (space between them if possible if not I can use any reasonable char)
What expression should I have for first filter and for second if I don’t know length of those values?
This is going to be tough without some sort of knowledge of what is in the subject and what determines values versus plain text subjects...

Subject: Help me
Subject: 1234 234
Subject: A: 1 B: 2

for default, you can have to have two postmaster filters.
(\w*)\s
and
\w*\s(\w*)\s

might be useful.
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
PiotrIr
Znuny newbie
Posts: 25
Joined: 02 Sep 2015, 17:37
Znuny Version: 4 Patch Level 11

Re: PostMaster filter copy specific values from Subject to “Set value”

Post by PiotrIr »

This works like a charm!

Thank you very much!
EXG133
Znuny expert
Posts: 217
Joined: 06 Aug 2012, 18:12
Znuny Version: 3.1.7 & 4.04

Re: PostMaster filter copy specific values from Subject to “Set value”

Post by EXG133 »

reneeb wrote:@EXG133: Therefor http://opar.perl-services.de/package/R/ ... sterFilter exists (maybe this will be integrated in OTRS6)
Installed it, configured it and works way better than what I hardcoded. Thanks! I will suggest OTRS they include this in the core, very convenient.
PiotrIr
Znuny newbie
Posts: 25
Joined: 02 Sep 2015, 17:37
Znuny Version: 4 Patch Level 11

Re: PostMaster filter copy specific values from Subject to “Set value”

Post by PiotrIr »

EXG133

This module works great, thank you!

I need only two things to be perfectly happy of OTRS so maybe you know modules or solutions which can help me?
1. Report (stat) which will show notes as well, not only titles.
2. Way to copy value from e-mail to “Time units (work units):”
Locked