Views
Create, Update, Delete and Query Views in Zendesk.
Table Specific Information
Select
The following queries are processed server side while other filters are processed client side by the 本製品. Allowed for agents.
SELECT * FROM Views WHERE Id = '123' SELECT * FROM Views WHERE GroupId = '123' SELECT * FROM Views WHERE Access = 'Shared' SELECT * FROM Views WHERE Active = true SELECT * FROM Views ORDER BY CreatedAt SELECT * FROM Views ORDER BY UpdatedAt SELECT * FROM Views WHERE Id in (18578482641937, 18578439448081)
You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any other search criteria will be ignored and an unfiltered response will be returned.
Insert
The Columns Title and ConditionsAll are required to insert. A suitable combination of Field, Operator and Value is required for insertion in ConditionsAll and ConditionsAny. Here is a list of the possible combinations: "https://developer.zendesk.com/documentation/ticketing/reference-guides/conditions-reference/". Allowed for agents.
INSERT INTO ViewsConditionsAll#temp(Field, Operator, Value) VALUES('status', 'less_than', 'solved') INSERT INTO ViewsConditionsAny#temp(Field, Operator, Value) VALUES('assignee_id', 'is', '18211830670225') INSERT INTO Views(Title,ConditionsAll, ConditionsAny, ExecutionColumns, ExecutionGroupBy, ExecutionGroupOrder, ExecutionSortBy, ExecutionSortOrder) VALUES('Test title', 'ViewsConditionsAll#temp', 'ViewsConditionsAny#temp', 'status;requester;asignee', 'asignee', 'desc', 'status', 'desc')
Update
You must specify the Id of the View to update it. ConditionsAll and ConditionsAny aggregate columns support duplicate values in the object, so in order to update these fields, you must specifty the whole aggregate object. All fields that are not readonly (readonly="false" in the table) are optional. Allowed for agents.
INSERT INTO ViewsConditionsAll#temp(Field, Operator, Value) VALUES('status', 'less_than', 'solved') INSERT INTO ViewsConditionsAny#temp(Field, Operator, Value) VALUES('assignee_id', 'is', '18211830670225') UPDATE Views SET Title='Updated Title', ConditionsAll='ViewsConditionsAll#temp', ConditionsAny='ViewsConditionsAny#temp' WHERE Id='18551415691665'
To update multiple Views.
INSERT INTO Views#temp(Id, Position) VALUES(18578482641937, 5) INSERT INTO Views#temp(Id, Position) VALUES(18578439448081, 6) UPDATE VIEWS(Id, Position) Select Id, Position FROM Views#temp
Delete
You must specify the Id of the view to delete it. Allowed for agents.
DELETE FROM Views WHERE Id = '123'
To delete multiple Views.
INSERT INTO Views#temp(Id) VALUES(18578482641937) INSERT INTO Views#temp(Id) VALUES(18578439448081) DELETE FROM Views WHERE EXISTS Select Id FROM Views#temp
Note: There is a limitation on the API side in the case of Bulk Update and Bulk Delete. When you try to update or delete multiple records with at least one invalid Id, the API will throw a 404 not found exception. Due to this limitation, the LastResultInfo#temp for this table shows an empty resultset.
Columns
Name | Type | ReadOnly | References | Description |
Id [KEY] | Long | True |
Automatically assigned when the ticket is created. | |
Title | String | False |
The title of the view. | |
Active | Boolean | False |
Useful for determining if the view should be displayed. | |
SlaId | Long | False |
SlaPolicies.Id |
If the view is for an SLA, shows the id. |
RestrictionId | Long | True |
The id of the restricion (who may access this account. Will be null when everyone in the account can access it). | |
RestrictionType | String | False |
The type of the restricion (who may access this account. Will be null when everyone in the account can access it). | |
RestrictionIds | String | False |
The numeric IDs of a single or more groups. Recommended for 'Group' type. | |
Position | Integer | False |
The position of the view. | |
ExecutionGroupBy | String | False |
Group the tickets by a column in the View columns table. The subject and submitter columns are not supported. | |
ExecutionGroupOrder | String | False |
Group the tickets by a column in the View columns table either by specifying asc or desc. | |
ExecutionSortBy | String | False |
Sort the tickets by a column in the View columns table. The subject and submitter columns are not supported. | |
ExecutionSortOrder | String | False |
Sort the tickets by a column in the View columns table either by specifying asc or desc. | |
ExecutionGroup | String | False |
When present, the structure indicating how the tickets are grouped. | |
ExecutionSort | String | False |
The column structure of the field used for sorting. | |
ExecutionColumns | String | False |
The ticket fields to display. For Insert, give the list of value separated by semi-colon. | |
ExecutionFields | String | False |
Execution is an object describing how the view should be executed. | |
ExecutionCustomFields | String | False |
Execution is an object describing how the view should be executed. | |
ConditionsAll | String | False |
Logical AND. Tickets must fulfill all of the conditions to be considered matching.Conditions is an object describing how the view is constructed. | |
ConditionsAny | String | False |
Logical OR. Tickets may satisfy any of the conditions to be considered matching.Conditions is an object describing how the view is constructed. | |
CreatedAt | Datetime | True |
The time the view was created. | |
UpdatedAt | Datetime | True |
The time of the last update of the view. | |
Access | String | False |
Only views with given access. May be personal, shared, or account | |
GroupId | Long | False |
Groups.Id |
The group id the view belongs to. Used to query the table |
Default | Boolean | False |
If true, the view is a default view. | |
Description | String | False |
The description of the view. | |
RawTitle | String | False |
The raw title of the view. | |
Url | String | True |
Url. |