[ZBX-22225] After template.update (api request) doesnt add tag Created: 2023 Jan 19  Updated: 2023 Jan 24  Resolved: 2023 Jan 24

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Martin Sadovy Assignee: Edgar Akhmetshin
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

zabbix 6.2.6
zabbix agent 2



 Description   

Steps to reproduce:

  1. create one or more templates with no tags
  2. send api requests with template.update to replace tag on template (repeat for every created template)
  3. api response with no errors

 

Result:

After this steps, there in no tag on last updated template. If its one template it dont add the tag. If its two, it doesnt add to the last updated.

 

Expected:
All updated templates contains given tags.

 

Note: I try the same with tags on host, it works as expected.



 Comments   
Comment by Edgar Akhmetshin [ 2023 Jan 20 ]

Hello Martin,

Could you provide more details like how API was used and that ID of the template is matched the one API request changes? Not able to reproduce with 6.0.12 or 6.2.6 using examples from the official documentation:
https://www.zabbix.com/documentation/current/en/manual/api/reference/template/update

Regards,
Edgar

Comment by Martin Sadovy [ 2023 Jan 20 ]

Hi,

Of corse, I am using javascript library got for sending the request.

There is one example of request that dont work for me:

const response = await got.post('https://zabbix_url/zabbix/api_jsonrpc.php', {

{
           "jsonrpc": "2.0",
           "method": "template.update",
           "params": {
               "templateid": "10566",
               "tags": [
                   

{                        "tag": "test",                        "value": "test1"                    }

               ]
           },
           "auth": "xxxx",
           "id": 1

}

responseType: 'json',
headers: { 'Content-Type': 'application/json-rpc' },
});

api response:

{ jsonrpc: '2.0', result: \{ templateids: [ '10566' ] }

, id: 1 }

 

It seems very odd to whz its not working. 

 

Comment by Martin Sadovy [ 2023 Jan 20 ]

I realize after I add the tag I manual deleted it and after that the api request dont work. When i dont delete it manual it works fine. (delete it by api request)

Generated at Fri Jul 04 10:38:19 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.