mapping.rb 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Sequencer::Unit::Import::Zendesk::Ticket::Mapping < Sequencer::Unit::Base
  3. include ::Sequencer::Unit::Import::Common::Mapping::Mixin::ProvideMapped
  4. uses :resource, :user_id, :owner_id, :group_id,
  5. :organization_id, :priority_id, :state_id,
  6. :article_sender_id, :article_type_id,
  7. :subject
  8. def process
  9. provide_mapped do
  10. {
  11. id: resource.id,
  12. number: resource.id,
  13. title: subject,
  14. owner_id: owner_id,
  15. group_id: group_id,
  16. customer_id: user_id,
  17. organization_id: organization_id,
  18. priority_id: priority_id,
  19. state_id: state_id,
  20. pending_time: resource.due_at,
  21. updated_at: resource.updated_at,
  22. created_at: resource.created_at,
  23. updated_by_id: user_id,
  24. created_by_id: user_id,
  25. type: resource.type,
  26. create_article_sender_id: article_sender_id,
  27. create_article_type_id: article_type_id,
  28. }
  29. end
  30. end
  31. end