diff --git a/services/tickets/zendesk/service.go b/services/tickets/zendesk/service.go index 77c1ebc42..becac59dd 100644 --- a/services/tickets/zendesk/service.go +++ b/services/tickets/zendesk/service.go @@ -99,12 +99,12 @@ func (s *service) Open(session flows.Session, topic *flows.Topic, body string, a msg.Message = body } else { extra := &struct { - Message string `json:"message"` - Priority string `json:"priority"` - Subject string `json:"subject"` - Description string `json:"description"` - CustomFields []FieldValue `json:"custom_fields"` - Tags []string `json:"tags"` + Message string `json:"message"` + Priority string `json:"priority"` + Subject string `json:"subject"` + Description string `json:"description"` + CustomFields interface{} `json:"custom_fields"` + Tags []string `json:"tags"` }{} err := jsonx.Unmarshal([]byte(body), extra) diff --git a/services/tickets/zendesk/service_test.go b/services/tickets/zendesk/service_test.go index 7ebb9fba3..dd946c926 100644 --- a/services/tickets/zendesk/service_test.go +++ b/services/tickets/zendesk/service_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" ) -const fieldTicket = `{"message":"Cookies","priority":"high","subject":"Where are my cookies?","description":"I want to know where is my cookie.","tags": ["TAG_01","TAG_02"],"custom_fields":[{"id":"21938362","value":"hd_3000"}]}` +const fieldTicket = `{"message":"Cookies","priority":"high","subject":"Where are my cookies?","description":"I want to know where is my cookie.","tags": ["TAG_01","TAG_02"],"custom_fields":[{"id":21938362,"value":"hd_3000"}]}` func TestOpenAndForward(t *testing.T) { ctx, rt, _, _ := testsuite.Get() diff --git a/services/tickets/zendesk/testdata/TestOpenAndForward_open_ticket.snap b/services/tickets/zendesk/testdata/TestOpenAndForward_open_ticket.snap index 126754e7d..8b57dd6f7 100644 --- a/services/tickets/zendesk/testdata/TestOpenAndForward_open_ticket.snap +++ b/services/tickets/zendesk/testdata/TestOpenAndForward_open_ticket.snap @@ -1,9 +1,9 @@ POST /api/v2/any_channel/push.json HTTP/1.1 Host: nyaruka.zendesk.com User-Agent: Go-http-client/1.1 -Content-Length: 631 +Content-Length: 697 Authorization: Bearer **************** Content-Type: application/json Accept-Encoding: gzip -{"instance_push_id":"1234-abcd","request_id":"sesame:1570461696000000000","external_resources":[{"external_id":"59d74b86-3e2f-4a93-aece-b05d2fdcde0c","message":"Cookies","thread_id":"59d74b86-3e2f-4a93-aece-b05d2fdcde0c","created_at":"2019-10-07T15:21:35Z","author":{"external_id":"5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f","name":"Ryan Lewis"},"allow_channelback":true,"fields":[{"id":"message","value":"Cookies"},{"id":"priority","value":"high"},{"id":"subject","value":"Where are my cookies?"},{"id":"description","value":"I want to know where is my cookie."},{"id":"custom_fields","value":[{"id":"21938362","value":"hd_3000"}]}]}]} \ No newline at end of file +{"instance_push_id":"1234-abcd","request_id":"sesame:1570461696000000000","external_resources":[{"external_id":"59d74b86-3e2f-4a93-aece-b05d2fdcde0c","message":"Cookies","thread_id":"59d74b86-3e2f-4a93-aece-b05d2fdcde0c","created_at":"2019-10-07T15:21:35Z","author":{"external_id":"5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f","name":"Ryan Lewis"},"allow_channelback":true,"fields":[{"id":"message","value":"Cookies"},{"id":"priority","value":"high"},{"id":"subject","value":"Where are my cookies?"},{"id":"description","value":"I want to know where is my cookie."},{"id":"custom_fields","value":[{"id":21938362,"value":"hd_3000"}]},{"id":"external_id","value":"59d74b86-3e2f-4a93-aece-b05d2fdcde0c"}]}]} \ No newline at end of file