Hacky: default value for new custom object in existing tickets

You actually have three options:

  • Scheduler task (this is, performance wise, the least immersive part)
  • API based
  • rails based
Dangerzone
Ticket.where(my_fancy_attribute_name: nil).find_in_batches do |t|
   t.update_all(my_fancy_attribute_name: 'attribute_value')
end

Note:

  • attribute name != attribute display name
  • attribute value != attribute display value

You absolutely want to update one existing ticket to learn how the value has to look like.
This will update all tickets where no value is yet set.

Keep in mind that this can be an issue on busy systems, consider a moment out of your business time to allow Zammads delayed jobs to not interfere with your daily business.

Above updates all tickets in 1000 steps. Each update means one delayed job for search indexing and n delayed jobs for any agent notification that might apply.

3 Likes