OTRS 3.1 approved.
This commit is contained in:
parent
e383dcb97a
commit
b4eb49ab57
1 changed files with 20 additions and 2 deletions
|
@ -510,6 +510,9 @@ module Import::OTRS2
|
||||||
|
|
||||||
result.each {|record|
|
result.each {|record|
|
||||||
|
|
||||||
|
# cleanup values
|
||||||
|
_cleanup(record)
|
||||||
|
|
||||||
ticket_new = {
|
ticket_new = {
|
||||||
:title => '',
|
:title => '',
|
||||||
:created_by_id => 1,
|
:created_by_id => 1,
|
||||||
|
@ -680,7 +683,7 @@ module Import::OTRS2
|
||||||
#puts "HS: #{record['History'].inspect}"
|
#puts "HS: #{record['History'].inspect}"
|
||||||
record['History'].each { |history|
|
record['History'].each { |history|
|
||||||
if history['HistoryType'] == 'NewTicket'
|
if history['HistoryType'] == 'NewTicket'
|
||||||
puts "HS.add( #{history.inspect} )"
|
#puts "HS.add( #{history.inspect} )"
|
||||||
res = History.add(
|
res = History.add(
|
||||||
:id => history['HistoryID'],
|
:id => history['HistoryID'],
|
||||||
:o_id => history['TicketID'],
|
:o_id => history['TicketID'],
|
||||||
|
@ -689,7 +692,7 @@ module Import::OTRS2
|
||||||
:created_at => history['CreateTime'],
|
:created_at => history['CreateTime'],
|
||||||
:created_by_id => history['CreateBy']
|
:created_by_id => history['CreateBy']
|
||||||
)
|
)
|
||||||
puts "res #{res.inspect}"
|
#puts "res #{res.inspect}"
|
||||||
end
|
end
|
||||||
if history['HistoryType'] == 'StateUpdate'
|
if history['HistoryType'] == 'StateUpdate'
|
||||||
data = history['Name']
|
data = history['Name']
|
||||||
|
@ -1243,4 +1246,19 @@ module Import::OTRS2
|
||||||
record['ValidID'] = true
|
record['ValidID'] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# cleanup invalid values
|
||||||
|
|
||||||
|
def self._cleanup(record)
|
||||||
|
record.each {|key, value|
|
||||||
|
if value == '0000-00-00 00:00:00'
|
||||||
|
record[key] = nil
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
# fix OTRS 3.1 bug, no close time if ticket is created
|
||||||
|
if record['StateType'] == 'closed' && ( !record['Closed'] || record['Closed'].empty? )
|
||||||
|
record['Closed'] = record['Created']
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
Loading…
Reference in a new issue