API leaves params in preprocessing when updating a step from the one with param to the one w/o a param.
Steps to reproduce:
- Create a host and item on this host with the following preprocessing settings:

- Take the ID of the created item (For example: Open the settings of the created item in UI and take the itemid from the "itemid" URL parameter.).
- Make the item.get API request with the given itemid:
POST {{api_url}}
Content-Type: application/json
Authorization: Bearer {{super_admin_token}}
{
"jsonrpc": "2.0",
"method": "item.get",
"params": {
"output": ["itemid"],
"selectPreprocessing": ["type", "params", "error_handler", "error_handler_params"],
"itemids": ["72008"]
},
"id": 1
}
and receive the similar response body:
{
"jsonrpc": "2.0",
"result": [
{
"itemid": "72008",
"preprocessing": [
{
"type": "12",
"params": "$.in.bytes",
"error_handler": "0",
"error_handler_params": ""
},
{
"type": "1",
"params": "8",
"error_handler": "0",
"error_handler_params": ""
},
{
"type": "10",
"params": "",
"error_handler": "0",
"error_handler_params": ""
}
]
}
],
"id": 1
}
- Update item preprocessing steps by swaping the 2nd and 3rd preprocessing steps without passing the "params" field for "Change per second" step:
POST {{api_url}}
Content-Type: application/json
Authorization: Bearer {{super_admin_token}}
{
"jsonrpc": "2.0",
"method": "item.update",
"params": [
{
"itemid": "72008",
"preprocessing": [
{
"type": "12",
"params": "$.in.bytes",
"error_handler": "0",
"error_handler_params": ""
},
{
"type": "10",
"error_handler": "0",
"error_handler_params": ""
},
{
"type": "1",
"params": "8",
"error_handler": "0",
"error_handler_params": ""
}
]
}
],
"id": 1
}
Result: The update was successfully done, but the "params" value still contain the value of the previous preprocessing type. It is possible to see when making the repeatable item.get request.
Expected: The value of "params" field should be set to default during the item.update.
- caused by
-
ZBXNEXT-6980 Implement audit log for item
-
- Closed
-
- causes
-
ZBX-28185 [Templates] Linux by Zabbix agent (active) templates cannot be cloned
-
- Closed
-