-
Problem report
-
Resolution: Won't fix
-
Trivial
-
None
-
5.0.20, 5.4.10
-
Debian 10.1 (kernel 4.19.0-18-amd64), zabbix-server 5.0.20, nginx 1.20
Steps to reproduce:
- In the item settings in the preprocessing tab, add the "javascript" step
- In the preprocessing parameters, add the context:
return value.search(/Ok/)>0 ? 1 : 0
This is a ternary operator that should return "1" if there is a search match in string
- Select the "test" action, in the "value" field enter the text:
Ok
- Press "test" button and you will get result 0.
If the context of the item value exactly matches the search string, then the result is always 0. But if part of the context matches, then the test returns 1.
Result:
See screenshot...
Expected:
It is expected that if the context of the item value exactly or does not completely match the search string, then the result is always 1.