[ZBXNEXT-4852] api trigger.get expand macro URL Created: 2018 Nov 08  Updated: 2018 Nov 08

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: API (A)
Affects Version/s: 4.0.1
Fix Version/s: None

Type: New Feature Request Priority: Minor
Reporter: Jorge Fernando Matsudo Iwano Assignee: Alexander Vladishev
Resolution: Unresolved Votes: 4
Labels: api, expand, macro, tigger.get
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CentOS 7, zabbix repo install.


Attachments: JPEG File 68fce506-a010-4d36-ab12-f5082840b79a.jpg     PNG File JSONLint - The JSON Validator - Google Chrome.png    

 Description   

Using API, method trigger.get do not expand native macros used in URL field. Only works in frontend but not using API.

Curiosly i find a partitial solution, changing the file "/usr/share/zabbix/include/classes/api/services/CTrigger.php" at line 465, adding follow lines.

------------------------------
if (!is_null($options['expandComment']) && $result && array_key_exists('url', reset($result))) {
$result = CMacrosResolverHelper::resolveTriggerUrls($result);
}
------------------------------

I used the existent option of "expandComment" to call "resolveTriggerUrls" to resolve my problem partialy.

I request in next release add this fix.

Thanks


Generated at Fri Apr 19 12:41:09 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.