2016-11-25 16:10:37 +00:00
|
|
|
module Import
|
|
|
|
module OTRS
|
|
|
|
module PriorityFactory
|
|
|
|
extend Import::Factory
|
2017-02-14 17:44:14 +00:00
|
|
|
|
|
|
|
# rubocop:disable Style/ModuleFunction
|
|
|
|
extend self
|
|
|
|
|
|
|
|
def import_loop(records, *_args, &import_block)
|
|
|
|
super
|
|
|
|
update_attribute_settings
|
|
|
|
end
|
|
|
|
|
|
|
|
def update_attribute_settings
|
|
|
|
return if Import::OTRS.diff?
|
2018-10-09 06:17:41 +00:00
|
|
|
|
2017-02-14 17:44:14 +00:00
|
|
|
update_attribute
|
|
|
|
end
|
|
|
|
|
|
|
|
def update_attribute
|
|
|
|
priority = ::Ticket::Priority.find_by(
|
|
|
|
name: Import::OTRS::SysConfigFactory.postmaster_default_lookup(:priority_default_create),
|
|
|
|
active: true
|
|
|
|
)
|
|
|
|
return if !priority
|
|
|
|
|
|
|
|
priority.default_create = true
|
|
|
|
priority.callback_loop = true
|
|
|
|
|
|
|
|
priority.save
|
|
|
|
end
|
2016-11-25 16:10:37 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|