Infos:
- Used Zammad version: 2.2.x
- Used Zammad installation source: DEB repo
- Operating system: deb 9
- Browser + version: all
Explanation
We’re already launching tickets via the systemd timers. The ticket data comes from a specific file which contains f. e. the following information:
{
"title":"This is my Ticket-Title",
"group": "Helpdesk",
"article":{"subject":"To-Do","body":"You really need to do your stuff","type":"note","internal":true},
"customer":"periticket@neuwied.de",
"note": "Note"
}
This is working nice so far. In addition to that we’re trying to assign the ticket to an agent at launch. We tried stuff like:
"agent": "$agentemail"
"agent": "$agentlogin"
"agent": "$agentfullname"
Update:
Alright after playing around a bit it seems that the needed attribute is owner_id
which probably is the equivalent to the user_id
.
So after getting the information from my user with User.find_by(login:"whatever")
in rails i’m getting user id: 12
.
Therefore using something like this should work:
{
"title":"This is my Ticket-Title",
"group": "Helpdesk",
"owner_id":"12",
"article":{"subject":"To-Do","body":"You really need to do your stuff","type":"note","internal":true},
"customer":"periticket@neuwied.de",
"note": "Note"
}
But it just launches a ticket without assigning any owner to it…
I already confirmed that the owner_id
really matches the user_id
for my user by creating a ticket and assigning it to myself manually.
Is there any documentation which fields can be used for this and how? We didn’t seem to find what we’re looking for on https://docs.zammad.org/en/latest/index.html.
Solution
Meh… silly me. It was a matter of rights after all. Just make sure the user who is creating the tickets has the rights to do this in each group. If this is given, something like this will work:
{
"title":"This is my Ticket-Title",
"group":"Helpdesk",
"owner":"$agentlogin",
"article":{"subject":"To-Do","body":"You really need to do your stuff","type":"note","internal":true},
"customer":"$customerlogin",
"note":"Note",
"tags":"fancy",
"location":"Somewhere"
}