2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2016-11-25 16:10:37 +00:00
|
|
|
module Import
|
|
|
|
module OTRS
|
|
|
|
class History
|
|
|
|
class Move < Import::OTRS::History
|
|
|
|
def init_callback(history)
|
|
|
|
data = history['Name']
|
|
|
|
# "%%Queue1%%5%%Postmaster%%1"
|
|
|
|
from = nil
|
|
|
|
to = nil
|
2021-05-12 11:37:44 +00:00
|
|
|
if data =~ %r{%%(.+?)%%(.+?)%%(.+?)%%(.+?)$}
|
2016-11-25 16:10:37 +00:00
|
|
|
from = $1
|
|
|
|
from_id = $2
|
|
|
|
to = $3
|
|
|
|
to_id = $4
|
|
|
|
end
|
|
|
|
@history_attributes = {
|
2018-12-19 17:31:51 +00:00
|
|
|
id: history['HistoryID'],
|
|
|
|
o_id: history['TicketID'],
|
|
|
|
history_type: 'updated',
|
|
|
|
history_object: 'Ticket',
|
2016-11-25 16:10:37 +00:00
|
|
|
history_attribute: 'group',
|
2018-12-19 17:31:51 +00:00
|
|
|
value_from: from,
|
|
|
|
value_to: to,
|
|
|
|
id_from: from_id,
|
|
|
|
id_to: to_id,
|
|
|
|
created_at: history['CreateTime'],
|
|
|
|
created_by_id: history['CreateBy']
|
2016-11-25 16:10:37 +00:00
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|