priority_factory.rb 739 B

12345678910111213141516171819202122232425262728293031323334
  1. module Import
  2. module OTRS
  3. module PriorityFactory
  4. extend Import::Factory
  5. # rubocop:disable Style/ModuleFunction
  6. extend self
  7. def import_loop(records, *_args, &import_block)
  8. super
  9. update_attribute_settings
  10. end
  11. def update_attribute_settings
  12. return if Import::OTRS.diff?
  13. update_attribute
  14. end
  15. def update_attribute
  16. priority = ::Ticket::Priority.find_by(
  17. name: Import::OTRS::SysConfigFactory.postmaster_default_lookup(:priority_default_create),
  18. active: true
  19. )
  20. return if !priority
  21. priority.default_create = true
  22. priority.callback_loop = true
  23. priority.save
  24. end
  25. end
  26. end
  27. end