[ZBX-19288] Incorrect pattern processing in "Expression" field in the create trigger wizard Created: 2021 Apr 26  Updated: 2021 Apr 26

Status: Open
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 4.0.31rc1, 5.0.11rc1, 5.2.7rc1, 5.4.0beta3
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Sergejs Olonkins Assignee: Zabbix Development Team
Resolution: Unresolved Votes: 0
Labels: triggerexpressions, triggerwizard
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: GIF File wizard_issues.gif    

 Description   

Problem description: There are a couple of issues with pattern parameter processing when creating a trigger through the "Create trigger" wizard in the list of items:
1 - if the pattern contains round brackets, then everything that is placed after the closing bracket is lost.
2 - if the pattern contains quotes (single, double) the quotes are not escaped. As result, if there is text after the quotes an error is retrieved when attempting to save the expression. Furthermore the pattern itself is not put into double quotes

Example:

Steps to reproduce:

  1. Create a host with an item with data type set to Log or Text
  2. Open the trigger creation wizard from the items list
  3. Enter a trigger name
  4. in the expression field write down an epression that contains opening+closing double quotes and text after them, for example: "abc" abc
  5. Add the expression and attempt to save the trigger
    Result 1: the double quotes are not escaped, as result the following error is returned:
    Incorrect trigger expression. Check expression part starting from "({111_test:trap.regexp("abc" abc)})<>0)".
    No permissions to referred object or it does not exist!
    
  6. change the expression of the trigger to something that contains round brackets, for example: gr(a|e)y jacket
  7. Add the expression and save the trigger.
  8. Open configuration of the trigger
    Result 2: the part of the expression that was placed after the closing bracket is lost.

Expected:
1 - string pattern in the expression should be automatically quoted
2 - if the expression contains double quotes, the escape character should be placed before them
3 - no part of the pattern should be lost, even if it contains round brackets.


Generated at Wed Jan 21 17:45:19 EET 2026 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.