[ZBX-25774] Top Items thresholds not working for as-is numeric values Created: 2024 Dec 20  Updated: 2026 Apr 01

Status: Resolved
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 7.2.0, 7.2.1rc1, 7.2.1rc2
Fix Version/s: 7.4.10rc1, 8.0.0beta1 (master)

Type: Problem report Priority: Major
Reporter: Kyle Harris Assignee: Aleksandrs Subins
Resolution: Unresolved Votes: 4
Labels: thresholds, topitems
Remaining Estimate: Not Specified
Time Spent: 18h
Original Estimate: Not Specified
Environment:

Ubuntu 24.04, Apache2, PostgreSQL


Attachments: PNG File image-2024-12-19-19-56-02-056.png     PNG File image-2024-12-19-19-57-48-481.png     PNG File image-2024-12-19-19-58-44-591.png     Text File threshold-1.patch     Text File threshold.patch     Text File topitems_threshold.patch    
Issue Links:
Causes
caused by ZBXNEXT-7689 Top hosts/items widget - improve item... Closed
Team: Team A
Sprint: S25-W50/51/52/01, S26-W04/05, S26-W06/07
Story Points: 1

 Description   

Steps to reproduce:

  1. Create a Top Items dashboard widget
  2. Add hosts
  3. Add items
  4. Set thresholds for items.  In my instance it is monitoring a vendor's api with 4 possible values, 0, 1, 2, 3.  Setting a base color (if desired, I'm not) works as expected, but thresholds do not change the background color of the value.  I've tried this for other item types and they do not work either.

Result:

 


**

 

Expected:

I set the base color to reflect what I expect it to look like.



 Comments   
Comment by Dimitri Bellini [ 2025 Sep 15 ]

Hi Guys,

the problem seems still present on 7.4.2, do you have ETA for a fix?

Thank you

Comment by Andrea Marconi [ 2025 Sep 15 ]

Hello,

I’m currently experiencing the same issue with Zabbix version 7.4.2 regarding widget functionality. This limitation is significantly impacting our ability to fully utilize the widget as intended.

A fix or workaround would be greatly appreciated to restore full usability.

Thank you,
Best Regards.

Comment by Dimitri Bellini [ 2025 Sep 23 ]

Hi DevTeam,

I don't any updates on this topic, did you face a some blocking problem to fix it?
Sorry for further post but it's an important feature for improving and provide better dashboards.

Thanks so much

Comment by Andrea Marconi [ 2025 Sep 23 ]

Hello, I would like to ask if there is a planned patch scheduled for the near future.

 

Thank you!

Comment by Nathan [ 2025 Dec 22 ]

Validado no Zabbix 7.2.12
Substitua a classe abaixo no arquivo /usr/share/zabbix/ui/widgets/topitems/views/widget.view.php

case CWidgetFieldColumnsList::DISPLAY_AS_IS:
$style = null;

if (array_key_exists('thresholds', $column) && is_numeric($value)) {
$numeric_value = (float) $value;
$threshold_color = null;

foreach ($column['thresholds'] as $threshold) {
if ($numeric_value >= $threshold['threshold'])

{ $threshold_color = $threshold['color']; }

}

if ($threshold_color !== null)

{ $style = 'background-color: #' . $threshold_color; }

}

if ($style === null && $color !== '')

{ $style = 'background-color: #' . $color; }

if ($style !== null)

{ $value_cell->addStyle($style); }

if (!$is_view_value)

{ return [$value_cell]; }

return [(new CCol())->addStyle($style), $value_cell];

Generated at Sat Apr 04 07:05:39 EEST 2026 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.