Get tickets
getTickets()
This will return all tickets sorted by the last changed date. hostware uses this information to check if any tickets have new admin answers, which are then imported using another function (TODO).
Parameters
None.
Response
Collection of TicketResponse() classes. Each class contains the following attributes:
Type | Name | Description |
|---|---|---|
mixed | id | The ID of the ticked. Usually integer or UUID. |
mixed | number | The number of the ticket. Sometimes, ticket systems have a readable display number |
mixed | customerId | The ID of the customer/contact in the ticketsystem. No mapping necessary |
mixed | customerEmail | The mail of the customer/contact in the ticketsystem. |
mixed | subject | The subject of the ticket. |
mixed | statusId | The current status of the ticket |
Carbon | createdAt | The date of creation |
Carbon | lastChangeAt | The date of last change |
Int or Null | departmentId | The department id in the ticketsystem |
String or Null | notes | Optional notes attached to the ticket |
Example Code
Testing
You can test this function when executing the following console command. This requires that you have a ticket in the database, where the ticket_provider_id is equal to your provider name.
The function gets called synchronously, you can dump() and debug as you like.