2c4ca0adfa
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.23.0 to 1.24.1. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.23.0...v1.24.1)
31 lines
826 B
Ruby
31 lines
826 B
Ruby
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
|
|
|
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?
|
|
|
|
custom_fields.select { |custom_field| ticket_field_map[ custom_field['id'] ].present? }
|
|
.to_h do |custom_field|
|
|
[
|
|
ticket_field_map[ custom_field['id'] ].to_sym, # remote_name
|
|
custom_field['value']
|
|
]
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|