Skip to content

Instantly share code, notes, and snippets.

@tstachl
Created July 14, 2014 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tstachl/734580988df47eb57c88 to your computer and use it in GitHub Desktop.
Save tstachl/734580988df47eb57c88 to your computer and use it in GitHub Desktop.
ticket = DeskApi.cases.create({
external_id: 123456,
subject: 'Subject',
description: 'Description',
priority: 1,
status: 'resolved',
type: 'email',
labels: ['Label 1', 'Label 2'],
custom_fields: {
my_key: 'My Value'
},
message: {
direction: 'in',
from: 'Customer <john@example.com>',
to: 'Support <support@example.com>',
subject: 'Subject',
status: 'received',
body: 'Some body',
created_at: '2014-07-14T13:06:19-07:00',
updated_at: '2014-07-14T13:06:19-07:00'
},
_links: {
assigned_user: { href: '/api/v2/users/123456' },
assigned_group: { href: '/api/v2/groups/123456' },
customer: { href: '/api/v2/customers/123456' }
},
created_at: '2014-07-14T13:06:19-07:00',
updated_at: '2014-07-14T13:06:19-07:00'
})
ticket.replies.create({
direction: 'out',
to: 'Customer <john@example.com>',
from: 'Support <support@example.com>',
subject: 'Subject',
status: 'sent',
body: 'Some body',
created_at: '2014-07-14T13:06:19-07:00',
updated_at: '2014-07-14T13:06:19-07:00'
})
ticket.notes.create({
body: 'Some note'
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment