This method allow you to change the properties associated with a ticket.
/api/v2/tickets/update
This method can be accessed by account tokens and user tokens where the associated user has access to the tickets UI.
The only required parameter is the ticket reference, all others are optional and should only be sent if you wish to change them.
ticket
- the reference of the ticket you wish to update (required)status
- the name or ID of the statuspriority
- the name or ID of the prioritydepartment
- the ID of the departmentsla
- the name or ID of the SLAteam
- the name or ID of the team (must be within the escalation path of the department)user
- the username or ID of the assigned user (must be within the assigned team)subject
- the ticket's subjecttag_list
- a space or comma separated list of tags for this ticketupdated_at
- the date/time the ticket was updated (optional). Formatting details can be found on the Date/Time Formatting page.reply_due_at
- the date/time the ticket reply is due (optional). Formatting details can be found on the Date/Time Formatting page.resolution_due_at
- the date/time the ticket resolution is due (optional). Formatting details can be found on the Date/Time Formatting page.custom[fieldname]
- a hash of custom field values where fieldname
is the system name of the custom field you wish to save.If you already have a contact method in your database which you wish to assign to this ticket, you can
provide the ID as contact_method
. This method have the same type as the current method.
If you don't already have a contact method, you can provide one which should be found or added based on
the data. The parameters to use for this is contact_method_data
and contact_name
.
Tickets can have multiple contact methods associated with them. Whenever an update is posted to a ticket
messages will be sent them too. In order to change these you can use the additional_contact_methods
parameter. If you use this, you must provide all contact methods which you wish to be present on
the ticket. Multiple methods should be separated by commas. For example, adam@atech.io,dave@atech.io,steve@atech.io
.
If an update is successful a 200 OK
status will be returned along with the ticket properties. If a validation error occurs, you will receive a 422 Unprocessable Entity
status along with an array of errors (see below).
{
"id": 32,
"reference": "LF-616004",
"subject": "Example API Ticket",
"message_id": "96762aac-7957-b1bf-53ba-e1da83e1ec56@sirportly.dev",
"submitted_at": "2012-02-03T12:00:12+00:00",
"reply_due_at": null,
"resolution_due_at": null,
"auth_code": "8z0m0hiyz9g1",
"additional_recipients": null,
"last_update_posted_at": null,
"first_response_time": null,
"first_resolution_time": null,
"resolution_time": null,
"last_respondant": null,
"update_count": 0,
"status": {
"id": 2,
"name": "Waiting for Staff",
"colour": "00a9da",
"status_type": 0
},
"priority": {
"id": 3,
"name": "Normal",
"colour": "0097cf",
"position": 3
},
"department": {
"id": 3,
"name": "Technical Support",
"brand": {
"id": 2,
"name": "Codebase",
"url": "http://www.codebasehq.com"
},
"escalation_path": {
"id": 2,
"name": "aTech Technical Support Path"
},
"private": false
},
"team": {
"id": 2,
"name": "1st Line Support"
},
"user": {
"id": 2,
"username": "charlie",
"first_name": "Charlie",
"last_name": "Smurthwaite",
"email_address": "charlie@atechmedia.com",
"time_zone": "UTC",
"created_at": "2012-02-02T16:09:55+00:00"
},
"sla": null,
"customer": {
"id": 1,
"name": "Adam Cooke",
"company": "aTech Media",
"pin": "484836"
},
"customer_contact_method": {
"id": 1,
"method_type": "email",
"data": "adam@atechmedia.com"
}
}
{
"errors": {
"priority_id": [
"can't be blank"
],
"status_id": [
"can't be blank"
]
}
}