customer_update.rb 430 B

1234567891011121314151617
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class Service::Ticket::CustomerUpdate < Service::BaseWithCurrentUser
  3. def execute(ticket:, customer:, organization: nil)
  4. Pundit.authorize current_user, ticket, :agent_update_access?
  5. ticket.with_lock do
  6. ticket.customer = customer
  7. ticket.organization = organization if organization
  8. ticket.save!
  9. end
  10. ticket
  11. end
  12. end