diff.rb 732 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. module Import
  2. module OTRS
  3. module Diff
  4. # rubocop:disable Style/ModuleFunction
  5. extend self
  6. def diff_worker
  7. return if !diff_import_possible?
  8. diff
  9. end
  10. def diff?
  11. return true if @diff
  12. false
  13. end
  14. private
  15. def diff_import_possible?
  16. return if !Setting.get('import_mode')
  17. return if Setting.get('import_otrs_endpoint') == 'http://otrs_host/otrs'
  18. true
  19. end
  20. def diff
  21. log 'Start diff...'
  22. @diff = true
  23. check_import_mode
  24. updateable_objects
  25. # get changed tickets
  26. ticket_diff
  27. end
  28. def ticket_diff
  29. import('Ticket', diff: true)
  30. end
  31. end
  32. end
  33. end