Used Zammad version: 6.4.0-1732871355.611ba7e2.bullseye
Used Zammad installation type: package
Operating system: Debian GNU/Linux 11 (bullseye)
Browser + version: Firefox 128.5.0 esr
Actual behavior:
I need to move the tickets from one customer (user) to another. I can do this manually for each individual ticket, but if there are over 100 tickets, then it’s too much manual work for me. Is there another way?
Expected behavior:
I would like something like that.
GET new_customer id Where Email = new_cust_email;
Get old_customer id Where Email = old_cust_email;
Update all Tickets Set CustomerID = new_customer_id Where Customer_id = old_customerid
How could this be done with Zammad.
Thanks for Help
You can create an overview for only this “user”. Than create a macro, which changes the user to the new user.
In the overview you can select all tickets and start the macro by draggin the tickets to the top and all macros should show up.
If i remember correctly, you will get a list of 50 (or was it 100?) tickets in the overview. So you will have to do the task more than once. But it’s not for every single ticket.
Hope that helps.
cid = Ticket.find_by(number:‘20240620110130’).customer_id
So this is customer_id e.g. 15685.
Ticket.where(customer_id:‘15685’).count
Just to know how much tickets the customer has. Now you can do:
Ticket.where(customer_id:‘15685’).update_all(customer_id: 1)
Perhaps that helps. But I also like the macro solution.
update_all skips important rails triggers that are required for certain things. This may draw e.g. the searchindex inacurate. Also, user ID 1 is system.
So if we provide rails console commands for that, you’d rather find the users you want to find via User.find_by(email: 'email@domain.tld').id