2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2018-01-08 15:29:34 +00:00
|
|
|
class Sequencer
|
|
|
|
class Unit
|
|
|
|
module Import
|
|
|
|
module Zendesk
|
|
|
|
module Ticket
|
|
|
|
class StateID < Sequencer::Unit::Common::Provider::Named
|
|
|
|
|
|
|
|
uses :resource
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def state_id
|
|
|
|
::Ticket::State.select(:id).find_by(name: local).id
|
|
|
|
end
|
|
|
|
|
|
|
|
def local
|
|
|
|
mapping.fetch(resource.status, resource.status)
|
|
|
|
end
|
|
|
|
|
|
|
|
def mapping
|
|
|
|
{
|
|
|
|
'pending' => 'pending reminder',
|
|
|
|
'solved' => 'closed',
|
|
|
|
'deleted' => 'removed',
|
2019-01-28 05:56:42 +00:00
|
|
|
'hold' => 'open'
|
2018-01-08 15:29:34 +00:00
|
|
|
}.freeze
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|