Create View
POST {{baseUrl}}/api/v2/views
Allowed For
- Agents
JSON Format
The JSON format consists of one property, a view
object that lists the values to set when the view is created.
Note: The request must include at least one condition in the all
array that checks one of the following fields: status
, type
, group_id
, assignee_id
, or requester_id
.
Name | Description |
---|---|
title | Required. The title of the view |
all | Required. An array of one or more conditions. A ticket must meet all of them to be included in the view. See Conditions reference |
any | An array of one or more conditions. A ticket must meet any of them to be included in the view. See Conditions reference |
description | The description of the view |
active | Allowed values are true or false. Determines if the view is displayed or not |
output | An object that specifies the columns to display. Example: "output": {"columns": ["status", "description", "priority"]} . See View columns |
restriction | An object that describes who can access the view. To give all agents access to the view, omit this property |
The restriction
object has the following properties.
Name | Comment |
---|---|
type | Allowed values are Groupor User |
id | The numeric ID of a single group or user |
ids | The numeric IDs of a single or more groups. Recommended for Group type |
If type
is Group
, the ids
property is the preferred method of specifying the group id or ids.
Example Request Body
{
"view": {
"title": "Kelly's tickets",
"raw_title": "{{dc.tickets_assigned_to_kelly}}",
"description": "Tickets that are assigned to Kelly",
"active": true,
"position": 3,
"restriction": {
"type": "User",
"id": "213977756"
},
"all": [
{
"field": "status",
"operator": "less_than",
"value": "solved"
},
{
"field": "group_id",
"operator": "is",
"value": "24000932"
},
{
"field": "custom_fields_360011872073",
"operator": "is",
"value": "Canada"
},
...
],
"output": {
"columns": ["status", "requester", "assignee"],
"group_by": "assignee",
"group_order": "desc",
"sort_by": "status",
"sort_order": "desc"
}
}
}
View columns
The output
request parameter lets you specify what columns to include in the view in the agent interface. Example: "output": {"columns": ["status", "description", "priority"]}
. The following table lists possible columns for views in the agent UI and the corresponding values in the columns
array.
For custom fields, specify the id of the custom field in the columns
array.
You can specify a total of 10 columns to a view.
View column title in UI | Value |
---|---|
Assigned | assigned |
Assignee | assignee |
Due Date | due_date |
Group | group |
ID | nice_id |
Updated | updated |
Assignee updated | updated_assignee |
Requester updated | updated_requester |
Updater | updated_by_type |
Organization | organization |
Priority | priority |
Requested | created |
Requester | requester |
Requester language | locale_id |
Satisfaction | satisfaction_score |
Solved | solved |
Status category | status |
Subject | description |
Submitter | submitter |
Ticket form | ticket_form |
Type | type |
Brand | brand |
Ticket status | custom_status_id |
View sorting
You can group and sort items in the view by adding items to the output
parameter:
Attribute | Description |
---|---|
group_by , sort_by | Sort or group the tickets by a column in the View columns table. The subject and submitter columns are not supported |
group_order , sort_order | Either ascor desc |
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Accept | string |
RESPONSES
status: OK
{"view":{"active":true,"conditions":{"all":[{"field":"status","operator":"is","value":"open"},{"field":"priority","operator":"less_than","value":"high"}],"any":[{"field":"current_tags","operator":"includes","value":"hello"}]},"id":9873843,"title":"Roger Wilco"}}