Regex filter not working as expected

  • Used Zammad version: 4.1.x
  • Used Zammad installation type: Package
  • Operating system: Ubuntu Server 20.04
  • Browser + version: Chrome (latest)

Expected behaviour:

  • Email filter matches on 1 regex only.

Actual behaviour:

  • Email matches on multiple regex filters, despite having the regex only matching the one

Steps to reproduce the behaviour:

  • If you enter the data as below, it should replicate the issue

Hi all,

I am trying to have my tickets filtered via the Email filters using regex. I have them all done, except for this 1. I keep hitting this issue, and I am confident that i have the regex string correct.

I use regex101.com for my regex query building, and looking at the output from it, it indicates that it should be operating as expected. However, the email matches more than 1 filter, and has the actions of both applied to the ticket.

I am trying to control the direction of a ticket by using regex matching in the body. Below are the possible options that can come from this specific subscription. This information is contained in the BODY of the ticket, and have the filter set accordingly.

Policy Update
Policy Update Failure

Reboot Pending
Reboot Completed
Product Update Started
Product Update Completed
Product Update Failed
Update: Reboot Required
Update: Reboot Advised
Update: Unexpected Reboot Required

Component Download Success
Signature Set Update Success
Component Download Failure
Signature Set Update Failure

I have 2 filters setup to perform different actions based on what the ticket contains.

I have the following filter which matches the items in bold. This action works as expected, and looking at the output from regex101, it indicates that i have the query correct.

  • List regex:(Fail|Update:)

Policy Update
Policy Update Failure

Reboot Pending
Reboot Completed
Product Update Started
Product Update Completed
Product Update Failed
Update: Reboot Required
Update: Reboot Advised
Update: Unexpected Reboot Required

Component Download Success
Signature Set Update Success
Component Download Failure
Signature Set Update Failure

I also have the following query, which matches everything correctly (shown in BOLD), but it also matches in zammad for something it shouldn’t (shown in BOLD ITALIC). So when a ticket comes through, cotaining the string Policy Update Failure, It matches the policy above, and has those actions applies. But it also matches another one, and has them applied also. This is an issue, as it wont work for the automation im trying to generate. Looking at the query in regex101, it indicates that i have the query correct.

  • (Pending|Completed|Started|Success|Policy Update$)

Policy Update
Policy Update Failure

Reboot Pending
Reboot Completed
Product Update Started
Product Update Completed
Product Update Failed
Update: Reboot Required
Update: Reboot Advised
Update: Unexpected Reboot Required

Component Download Success
Signature Set Update Success
Component Download Failure
Signature Set Update Failure

The intended action is that Policy Update Failure will match only the first regex filter. but this is not the case.

Below is the specific log entry for the ticket in question relating to the email filter settings.

INFO -- :   matching content 'subject' contains regex: REDACTED
INFO -- :   matching content 'to' contains regex: REDACTED
INFO -- :   matching content 'body' contains regex:(Fail|Update:)
INFO -- :   matching content 'subject' contains regex: REDACTED
INFO -- :   matching content 'to' contains regex: REDACTED
INFO -- :   matching content 'body' contains regex:(Pending|Completed|Started|Success|Policy Update$)

Any help on this would be great.
Thanks.
Jason

bump…

any suggestions?

for now i have had to work around it and remove the Policy Update section from the filter, and am manually performing the actions on those tickets. Whilst infrequent, its still less than ideal. As we don’t want the ticket even generated for that condition.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.