-
Type:
Problem report
-
Resolution: Won't fix
-
Priority:
Critical
-
None
-
Affects Version/s: 3.2.7
-
Component/s: API (A)
-
None
When I am assigning users in operations in Actions using the API the userIDs are getting cut. It always picks only the first character.
For example everything is fine when the userIDs are between 0 - 9. After that if I try to add user with ID from 10 to 19, it grabs only the first char -> 1. So it tries to add user with id 1 (by default is the Admin). When I have users with IDs between 20 and 29 it tries to add user with id 2 (by default guest) ... and so on.
So somewhere where you are parsing the userIDs something is wrong in the API. It works fine using the UI.
This problem persist in the old version 3.2.6 too.
I am always able to replicate the problem.
1.Make fresh new zabbix server install.
2.Add 10+ users
3.Try to assign user with ID 10+ to an operations in Action using the API.
4.It is the same problem for action.create and action.update.
Here is the call you have to make as per documentation
{
"jsonrpc": "2.0",
"method": "action.create",
"params": {
"name": "Trigger action",
"eventsource": 0,
"status": 0,
...
"operations": [
{
...
"opmessage_usr": [
],
....
The problem is 'opmessage_usr'. In this case it will try to add 2 times the user with ID 1.