Working on issue #558 - Zendesk ticket owner won't get imported.

This commit is contained in:
Thorsten Eckel 2016-12-19 14:45:12 +01:00
parent 6fafb3f0bf
commit de24df9728
2 changed files with 7 additions and 0 deletions

View file

@ -40,6 +40,7 @@ module Import
{ {
id: ticket.id, id: ticket.id,
title: ticket.subject, title: ticket.subject,
owner_id: Import::Zendesk::UserFactory.local_id( ticket.assignee ) || 1,
note: ticket.description, note: ticket.description,
group_id: Import::Zendesk::GroupFactory.local_id( ticket.group_id ) || 1, group_id: Import::Zendesk::GroupFactory.local_id( ticket.group_id ) || 1,
customer_id: local_user_id, customer_id: local_user_id,

View file

@ -11,6 +11,7 @@ RSpec.describe Import::Zendesk::Ticket do
id: 1337, id: 1337,
subject: 'The ticket title', subject: 'The ticket title',
description: 'An example ticket', description: 'An example ticket',
assignee: 69,
requester_id: 42, requester_id: 42,
group_id: 909, group_id: 909,
organization_id: 101, organization_id: 101,
@ -29,6 +30,7 @@ RSpec.describe Import::Zendesk::Ticket do
title: ticket.subject, title: ticket.subject,
note: ticket.description, note: ticket.description,
group_id: 3, group_id: 3,
owner_id: 101,
customer_id: local_user_id, customer_id: local_user_id,
organization_id: 89, organization_id: 89,
state: 13, state: 13,
@ -43,6 +45,7 @@ RSpec.describe Import::Zendesk::Ticket do
} }
expect(Import::Zendesk::UserFactory).to receive(:local_id).with( ticket.requester_id ).and_return(local_user_id) expect(Import::Zendesk::UserFactory).to receive(:local_id).with( ticket.requester_id ).and_return(local_user_id)
expect(Import::Zendesk::UserFactory).to receive(:local_id).with( ticket.assignee ).and_return(expected_structure[:owner_id])
expect(Import::Zendesk::GroupFactory).to receive(:local_id).with( ticket.group_id ).and_return(expected_structure[:group_id]) expect(Import::Zendesk::GroupFactory).to receive(:local_id).with( ticket.group_id ).and_return(expected_structure[:group_id])
expect(Import::Zendesk::OrganizationFactory).to receive(:local_id).with( ticket.organization_id ).and_return(expected_structure[:organization_id]) expect(Import::Zendesk::OrganizationFactory).to receive(:local_id).with( ticket.organization_id ).and_return(expected_structure[:organization_id])
@ -70,6 +73,7 @@ RSpec.describe Import::Zendesk::Ticket do
id: 1337, id: 1337,
subject: 'The ticket title', subject: 'The ticket title',
description: 'An example ticket', description: 'An example ticket',
assignee: 69,
requester_id: 42, requester_id: 42,
group_id: 909, group_id: 909,
organization_id: 101, organization_id: 101,
@ -88,6 +92,7 @@ RSpec.describe Import::Zendesk::Ticket do
title: ticket.subject, title: ticket.subject,
note: ticket.description, note: ticket.description,
group_id: 3, group_id: 3,
owner_id: 101,
customer_id: local_user_id, customer_id: local_user_id,
organization_id: 89, organization_id: 89,
state: 13, state: 13,
@ -102,6 +107,7 @@ RSpec.describe Import::Zendesk::Ticket do
} }
expect(Import::Zendesk::UserFactory).to receive(:local_id).with( ticket.requester_id ).and_return(local_user_id) expect(Import::Zendesk::UserFactory).to receive(:local_id).with( ticket.requester_id ).and_return(local_user_id)
expect(Import::Zendesk::UserFactory).to receive(:local_id).with( ticket.assignee ).and_return(expected_structure[:owner_id])
expect(Import::Zendesk::GroupFactory).to receive(:local_id).with( ticket.group_id ).and_return(expected_structure[:group_id]) expect(Import::Zendesk::GroupFactory).to receive(:local_id).with( ticket.group_id ).and_return(expected_structure[:group_id])
expect(Import::Zendesk::OrganizationFactory).to receive(:local_id).with( ticket.organization_id ).and_return(expected_structure[:organization_id]) expect(Import::Zendesk::OrganizationFactory).to receive(:local_id).with( ticket.organization_id ).and_return(expected_structure[:organization_id])