[Solved] Process Transition condition type

Moderator: crythias

Post Reply
lis9
OTRS newbie
Posts: 12
Joined: 13 Apr 2017, 11:27
OTRS Version?: 6.0.27
Real Name: Daniel
Company: Komputronik S.A.

[Solved] Process Transition condition type

Post by lis9 »

Hello!

I would like to ask you for transition condition type regex. The documentation says: (https://doc.otrs.com/doc/manual/admin/6 ... .7.3.5.5.3)
"Regex: The field value can be tested with a regular expression. It is important that Match contains qr{}xms as a base condition. Between the braces the actual regular expression can be noted."

Unfortunately I've got two problems: in exported process source file (yml) instead of "Regex" type we have "Regexp" and I have tried many possible combinations like qr{^ZH.*$}xms or qr{'^ZH.*$'}xms and list full of other delimiters for regex string like (),"", // and so forth.

Because I have previously reported few bugs to process management code I think that it may be an another bug, but I like to ask if somebody knows what is the proper formatting of regex condition to make the transaction to be called successfully. I still hope there is my fault somewhere.

Best regards
Daniel Lisiecki
Last edited by lis9 on 08 Apr 2021, 19:50, edited 1 time in total.

root
Administrator
Posts: 2659
Joined: 18 Dec 2007, 12:23
OTRS Version?: Znuny LTS and 4/5/6
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Process Transition condition type

Post by root »

Hi,

I think you misunderstood the manual. This is a working condition in one of my test systems, matching states containing the term closed
2021-04-06 at 9.24 PM.png
I suggest that you go just with

Code: Select all

^ZH.*$
- Roy

P.S.: Do you use the GUI for creating the processes, right?
You do not have the required permissions to view the files attached to this post.
Znuny LTS and ((OTRS) Community Edition CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know why ?

lis9
OTRS newbie
Posts: 12
Joined: 13 Apr 2017, 11:27
OTRS Version?: 6.0.27
Real Name: Daniel
Company: Komputronik S.A.

Re: Process Transition condition type

Post by lis9 »

Yes right. I use the GUI to create processes.

Unfortunately the working solution seems to be ZH* without ^$. It's sad because I cannot look for empty/whitespace field using such regex as (^$)|(\s+$). It seems that the only solution is to write my own transition validation module :-(

In your example your condition is equivalent to type String and fixed value, no wildcards.

Thank you very much for your assistance!

jojo
OTRS Employee
Posts: 14891
Joined: 26 Jan 2007, 14:50
OTRS Version?: Git Master
Contact:

Re: Process Transition condition type

Post by jojo »

.* works fine for anything and ^$ for empty. Please note that a dynamic field if it has no value is not existant for this ticket so checking on empty will not work here
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com

root
Administrator
Posts: 2659
Joined: 18 Dec 2007, 12:23
OTRS Version?: Znuny LTS and 4/5/6
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Process Transition condition type

Post by root »

lis9 wrote:
06 Apr 2021, 22:02
In your example your condition is equivalent to type String and fixed value, no wildcards.
Not really. My examples matches e.g. these states

- closed successful
- closed successful
- closed
- closed with workaround


A regular expression may contain a wildcard or other pattern but this is not mandatory.

- Roy
Znuny LTS and ((OTRS) Community Edition CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know why ?

lis9
OTRS newbie
Posts: 12
Joined: 13 Apr 2017, 11:27
OTRS Version?: 6.0.27
Real Name: Daniel
Company: Komputronik S.A.

Re: Process Transition condition type

Post by lis9 »

jojo wrote:
06 Apr 2021, 22:05
.* works fine for anything and ^$ for empty. Please note that a dynamic field if it has no value is not existant for this ticket so checking on empty will not work here
Yes, I'm aware of that, but my situation is quite different. I have some values in DF type textarea. Every line begins with ZH-<number>. I want to call transition action when the field gets emptied by user. It can be completely empty or can contain white spaces.
My idea was to call transition when DF contains any ZH string, and call other transaction when it does not. If DF emptied by user gets DF nonexistent in ticket my belief to create own validation module seems to be right even more.

Post Reply