Changing ticket properties

This method allow you to change the properties associated with a ticket.

URL

/api/v2/tickets/update

Access

This method can be accessed by account tokens and user tokens where the associated user has access to the tickets UI.

Supported Parameters

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 status
  • priority - the name or ID of the priority
  • department - the ID of the department
  • sla - the name or ID of the SLA
  • team - 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 subject
  • tag_list - a space or comma separated list of tags for this ticket
  • updated_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.

Passing custom fields

  • custom[fieldname] - a hash of custom field values where fieldname is the system name of the custom field you wish to save.

Changing the contact associated with a ticket

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.

Adding/Removing Additional Contact Methods

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.

Returned Data

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).

Example JSON

A successful ticket update

{
  "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"
  }
}

A failed ticket update

{
  "errors": {
    "priority_id": [
      "can't be blank"
    ],
    "status_id": [
      "can't be blank"
    ]
  }
}

Proudly powered by Katapult. Running on 100% renewable energy.