Help creating periodically launched tickets


  • Used Zammad version: 2.2.x
  • Used Zammad installation source: DEB repo
  • Operating system: deb 9
  • Browser + version: all


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},
"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"

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",
    "article":{"subject":"To-Do","body":"You really need to do your stuff","type":"note","internal":true},
    "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


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",
"article":{"subject":"To-Do","body":"You really need to do your stuff","type":"note","internal":true},


you are creating tickets now via REST and a custom script to create scheduled tickets? Or what do you use?



we created a systemd service for accessing the zammad api periodically.


For creating a “backup control” ticket Mo-Fri at 6am we created two files.

The service-file:


   Description=periodische Tickets erstellen %I

   ExecStart=/usr/bin/curl -H "Authorization: Token token=$AccessTokenOfTheDefinedUser" -H "Content-Type: application/json"  --data "@/home/zammad/periTickets/%i"  https://$ServerURL/api/v1/tickets

The timer-file:


   Description=Launch %i Ticket every x

   OnCalendar=Mon..Fri *-*-* 06:00:00
   #Syntax: DayOfWeek Year-Month-Day Hour:Minute:Second
   #Beispiel: OnCalendar=Mon,Tue *-*-01..04 12:00:00


Inside the .service-file we defined that the data for the ticket comes from a file (/home/zammad/periTickets/%i, %i being whatever is between the @ and the . of the service-file).

So all the information for the api to create a ticket goes into this file:


     "title":"Daily backup control",
     "owner":"$WhoEverTheOwnerShouldBe(leave empty for no owner)",
      "body":"Please check the status of the daily backup\n\nSee https://backupserver for more information.",

Once we have all those files we only need one command to enable the timer:

systemctl enable ticketTimer@backup-control.timer --now

Now the ticket is launched based on the definition inside the timer-File.
To start a ticket manually (for testing) you can do:

systemctl start ticketTimer@backup-control.service

To check if all the timers a set correctly you can do:

systemctl list-timers

Of course you could do all this with cron but we prefer systemd for this :slight_smile:.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.