ticket.rb 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class TriggerWebhookJob::CustomPayload::Track::Ticket < TriggerWebhookJob::CustomPayload::Track
  3. def self.root?
  4. true
  5. end
  6. def self.klass
  7. 'Ticket'
  8. end
  9. def self.functions
  10. klass.constantize.attribute_names + %w[
  11. created_by
  12. current_state_color
  13. customer
  14. group
  15. organization
  16. owner
  17. priority
  18. state
  19. updated_by
  20. ].freeze
  21. end
  22. def self.replacements(pre_defined_webhook_type:)
  23. user_functions = TriggerWebhookJob::CustomPayload::Track::User.functions
  24. {
  25. ticket: functions,
  26. 'ticket.priority': TriggerWebhookJob::CustomPayload::Track::Ticket::Priority.functions,
  27. 'ticket.state': TriggerWebhookJob::CustomPayload::Track::Ticket::State.functions,
  28. 'ticket.group': TriggerWebhookJob::CustomPayload::Track::Group.functions,
  29. 'ticket.owner': user_functions,
  30. 'ticket.customer': user_functions,
  31. 'ticket.updated_by': user_functions,
  32. 'ticket.created_by': user_functions,
  33. 'ticket.organization': TriggerWebhookJob::CustomPayload::Track::Organization.functions,
  34. }
  35. end
  36. end