2018-01-08 15:29:34 +00:00
|
|
|
class Sequencer
|
|
|
|
class Unit
|
|
|
|
module Import
|
|
|
|
module Zendesk
|
|
|
|
module Ticket
|
|
|
|
class CustomFields < Sequencer::Unit::Import::Zendesk::Common::CustomFields
|
|
|
|
|
|
|
|
uses :ticket_field_map
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def remote_fields
|
|
|
|
custom_fields = resource.custom_fields
|
|
|
|
return {} if custom_fields.blank?
|
|
|
|
|
2020-11-30 16:34:04 +00:00
|
|
|
custom_fields.select { |custom_field| ticket_field_map[ custom_field['id'] ].present? }
|
|
|
|
.map do |custom_field|
|
2018-01-08 15:29:34 +00:00
|
|
|
[
|
|
|
|
ticket_field_map[ custom_field['id'] ].to_sym, # remote_name
|
|
|
|
custom_field['value']
|
|
|
|
]
|
|
|
|
end.to_h
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|