article_customer_factory.rb 558 B

12345678910111213141516171819202122232425
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. module Import
  3. module OTRS
  4. module ArticleCustomerFactory
  5. extend Import::Factory
  6. def skip?(record, *_args)
  7. return true if record['SenderType'] != 'customer'
  8. return true if create_by_id(record) != 1
  9. return true if record['From'].blank?
  10. false
  11. end
  12. private
  13. def create_by_id(record)
  14. return record['CreatedBy'].to_i if record['CreatedBy'].present?
  15. record['CreateBy'].to_i
  16. end
  17. end
  18. end
  19. end