[ZBX-23679] Script item: TEST does not work when using MACRO in parameters Created: 2023 Nov 08  Updated: 2023 Nov 27  Resolved: 2023 Nov 24

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 7.0.0alpha7
Fix Version/s: None

Type: Problem report Priority: Major
Reporter: Marek Rysavy Assignee: Zabbix Development Team
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File bug_script_item.mp4     PNG File image-2023-11-07-23-33-53-400.png    
Issue Links:
Duplicate
duplicates ZBX-23696 Script item parameters not being pass... Closed
Sprint: Support backlog

 Description   

Similar problem as ZBX-21818{}

Steps to reproduce:

  1. create host macro
  2. create Script item
  3. add param with value from example host macro
  4. add basic script (whatever you want)
    • var param=JSON.parse(value);
      return JSON.stringify(param);
  5. apply
  6. test
  7. get value and test
  8. return error
    • Cannot execute script: SyntaxError: invalid json (at offset 1) at [anon] (duktape.c:37568) internal at parse () native strict preventsyield at [anon] (function:1) preventsyield

bug_script_item.mp4

Result:
The problem seems to be in passing the macro to the test script. When I save the item and press execute now, zabbix returns the correct value in latest data.



 Comments   
Comment by Andrejs Griščenko [ 2023 Nov 24 ]

Closed as a duplicate of ZBX-23696.

Generated at Sun Apr 06 09:05:32 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.