[ZBX-21255] Macro funcitons aren't working on map element labels Created: 2022 Jun 27  Updated: 2024 Jul 25  Resolved: 2023 Aug 16

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 6.0.5
Fix Version/s: 6.0.21rc1, 6.4.6rc1, 7.0.0alpha4, 7.0 (plan)

Type: Problem report Priority: Trivial
Reporter: Igor Gorbach (Inactive) Assignee: Alexander Vladishev
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2022-06-27-15-49-59-919.png     PNG File image-2022-06-27-15-50-30-315.png     PNG File image-2022-06-27-15-50-40-101.png     PNG File image-2022-09-04-15-45-53-009.png    
Issue Links:
Causes
causes ZBX-23454 PHP runtime errors when using {ITEM.V... Closed
causes ZBX-24909 Macro functions not working in the de... Closed
Team: Team C
Sprint: Sprint 103 (Aug 2023)
Story Points: 1

 Description   

Steps to reproduce:

Create any map element

Use any float item into the label with fmtnum macro function usage to limit digits after the comma, as it had been described into documentation

https://www.zabbix.com/documentation/current/en/manual/config/triggers/expression#example-17

Example

Load: {{?last(/Zabbix server/system.cpu.load[all,avg5])}.fmtnum(1)} 

Result - Expression Macro working, trigger function not

Expected

Expression macro is allowed to use in map element labels, macro functions should work as well

Similar behavior on 6.0.0-6.0.5 versions

 



 Comments   
Comment by Alexander Vladishev [ 2022 Sep 04 ]

Expression macros in map element and shape labels are supported with some limitations.

Comment by Constantin Oshmyan [ 2022 Dec 12 ]

sasha wrote:

on macros in map element and shape labels are supported with some limitations

Yes, but the example in "Description" of this issue does use exactly the last() function.
Moreover, this macro is successfully expanded. What is wrong – the macro function {SOMETHING.fmtnum(...)} is not expanded in this context (see the initial screenshot – result is: "Load: {0.2.fmtnum(1)}" instead of expected "Load: 0.2".

Comment by Alexander Vladishev [ 2023 Aug 11 ]

Fixed in:

Generated at Tue Mar 25 22:52:21 EET 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.