merge.rb 452 B

1234567891011121314
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Service::Ticket::Merge < Service::BaseWithCurrentUser
  3. def execute(source_ticket:, target_ticket:)
  4. Pundit.authorize(current_user, source_ticket, :agent_update_access?)
  5. Pundit.authorize(current_user, target_ticket, :agent_update_access?)
  6. source_ticket.merge_to(
  7. ticket_id: target_ticket.id,
  8. created_by_id: current_user.id,
  9. )
  10. end
  11. end