Tickets
Create, update, delete, and query from tickets table
Table Specific Information
Select
The add-in will use the Freshdesk API to process WHERE clause conditions built with the following columns and operators. Most of the columns support server side filtering with the following operators: =,>,<,<=,>=,AND,OR. The rest of the filter is executed client side within the add-in.
For example, the following query is processed server side:
SELECT * FROM Tickets WHERE Status = 2 AND (Priority = 1 OR Type = 'Other')
The API allows only a subset of columns to be used as filter criteria in the WHERE clause. The following columns can be used:
- Id
- AgentId
- GroupId
- Priority
- Status
- Tag
- Type
- DueBy
- FirstResponseDueBy
- CreatedAt
- UpdatedAt
Insert
Email, Subject, Description, GroupId, Status and Priority are mandatory columns for Inserting/Creating a new ticket.
Every ticket uses fixed numerical values to denote its Status and Priority. Numerical values are given as:
Status:
- Open = 2
- Pending = 3
- Resolved = 4
- Closed = 5
Priority:
- Low = 1
- Medium = 2
- High = 3
- Urgent = 4
A new ticket can be inserted as following:
INSERT INTO Tickets (Description, Subject, Email, GroupId, Status, Priority) VALUES ('Details about the issue...', 'New support needed...', '[email protected]', 12345, 3, 2)
Update
Following is an example to update a ticket:
UPDATE Tickets SET Priority = 1 WHERE Id = 100
Delete
Following is an example to delete a ticket:
DELETE FROM Tickets WHERE Id = 100
Columns
| Name | Type | ReadOnly | Description |
| Id [KEY] | Integer | False |
Unique ID of the ticket. |
| AssociationType | String | False |
Association type of the ticket. |
| Archived | Boolean | False |
Whether or not the ticket has been archived. |
| Attachments | String | False |
attachments associated with ticket. |
| CcEmailsAggregate | String | False |
Email address added in cc field. |
| CompanyId | Bigint | False |
ID of the company to which ticket belongs. |
| CreatedAt | Datetime | False |
Ticket creation timestamp. |
| CustomFields | String | False |
Key value pairs containing the names and values of custom fields |
| Deleted | Boolean | False |
Whether or not the ticket has been deleted. |
| Description | String | False |
HTML content of the ticket. |
| DescriptionText | String | False |
Text content of the ticket. |
| DueBy | Datetime | False |
Timestamp that denotes when the ticket is due to be resolved. |
| String | False |
Email address of the requester. | |
| EmailConfigId | Bigint | False |
ID of the email config used for the ticket. |
| FacebookId | String | False |
Facebook ID of the requester. |
| FirstResponseDueBy | Datetime | False |
Time when first response is due. |
| FirstReSponseEscalated | Boolean | False |
If ticket has been escalated as result of response. |
| FwdEmailsAggregate | String | False |
Email address while forwarding a ticket. |
| GroupId | Bigint | False |
Group ID to which the ticket has been assigned. |
| IsEscalated | Boolean | False |
If ticket has been escalated for some reason. |
| Name | String | False |
Name of the requester. |
| Phone | String | False |
Phone number of the requester. |
| Priority | Integer | False |
Priority of the ticket. |
| ProductId | Bigint | False |
ID of the product associated with the ticket. |
| ReplyCcEmailsAggregate | String | False |
Email address added while replying. |
| RequesterId | Bigint | False |
ID of the requester of the ticket. |
| ResponderId | Bigint | False |
ID of the agent assigned to the ticket. |
| Source | Integer | False |
Channel throught which ticket was created. |
| Spam | Boolean | False |
If ticket has been marked as spam. |
| Status | Integer | False |
Status of the ticket. |
| Subject | String | False |
Subject of the ticket. |
| TagsAggregate | String | False |
Tags associated with ticket. |
| ToEmailsAggregate | String | True |
Email address to which ticket was sent. |
| Type | String | False |
Category/type of the ticket. |
| UpdatedAt | Datetime | True |
Ticket updated timestamp. |
| AgentRespondedAt | Datetime | True |
Timestamp for when agent last responded to the ticket |
| RequesterRespondedAt | Datetime | True |
Timestamp for when Customer last responded to the ticket |
| FirstRespondedAt | Datetime | True |
Timestamp for when agent first responded to the ticket |
| StatusUpdatedAt | Datetime | True |
Timestamp for when status of the ticket was updated |
| ReopenedAt | Datetime | True |
Timestamp for when the ticket was reopened |
| ResolvedAt | Datetime | True |
Timestamp for when the ticket was resolved |
| ClosedAt | Datetime | True |
Timestamp for when the ticket was closed |
| PendingSince | Datetime | True |
Timestamp since the ticket is pending |