… the pulldown in the ticket edit mask of exisitng tickets should reflect the default value and be set to false/ nein
Actual behavior:
If I open an existing ticket, the pulldown of the custom object shows “true/ ja”, so the ticket is stated as modified.
The attribute value in the database seems to be correct, as in the rails console output of Ticket.find(xxx), the value of the object is correctly stated as “false”
Steps to reproduce the behavior:
Create a boolean object for tickets (in my case “Sharepoint Ablage”)
Set the defailt value to “false”
Open an existing Ticket
See that the pulldown for “Sharepoint Ablage” is set to true
Zammad does not automatically update existing datasets.
This is by design, because big systems with millions of tickets would suffer completely from performance issues. “Just changing the value of an attribute” is not everything that happens in the background, it also creates delayed jobs for search indexing.
If you want to update a not yet populated, existing attribute for all your existing tickets, you can use the following command in a rails console. Please note above remarks and that this change is final, cannot be undone and you should have a backup.
Dangerzone
Ticket.where(my_attribute: nil).find_in_batches.each do |t|
t.update(my_attribute: false)
end
Hi MrGeneration
Sorry for the late response I’ve kind of lost my focus on this issue.
I’m not shure if my problem is stated clear enough. I have no problem if existing tickets do not get updated on new objects. My point is that if I edit a ticket (or some other dataobject with a custom object), the field does not reflect the confgured default value. As an example: default is set to “false” but if I edit the an old ticket, the object value is set to true)… So, maybe I’ll have to enter the “Dangerzone” and work around the issue by editing the existing data…
Best regards
Kay