Conditions reference
The following resources in the Support REST API use the conditions
property:
The SLA Policies has a filter
property that is identical to the conditions
property.
The conditions
property consists of an object that contains the conditions to check before performing an action. The object defines two arrays named all
and any
of one or more conditions.
Example
{
"conditions": {
"all": [
{"field": "status", "operator": "less_than", "value": "solved"},
{"field": "assignee_id", "operator": "is", "value": "296220096"}
],
"any": [
]
}
}
The first array lists all the conditions that must be met. The second array lists any condition that must be met.
Name | Type | Description |
---|---|---|
all | array | Logical AND. All the conditions must be met |
any | array | Logical OR. Any condition can be met |
Each condition in an array has the following properties:
Name | Type | Description |
---|---|---|
field | string | The name of a ticket field |
operator | string | A comparison operator |
value | string | The value of a ticket field |
Example
{"field": "status", "operator": "less_than", "value": "solved"}
When specifying conditions in a PUT or POST request, use the all
and any
arrays without the conditions
property. Example:
{
"all": [
{"field": "status", "operator": "less_than", "value": "solved"},
{"field": "assignee_id", "operator": "is", "value": "296220096"}
],
"any": [
{ "field": "current_tags", "operator": "includes", "value": "hello" }
],
...
}
Shared conditions
The following conditions are shared by ticket triggers, automations, views and SLA policies.
field | operator | value |
---|---|---|
group_id | "is", "is_not" | "" (no group assigned to the ticket) or the numeric id of the group assigned to the ticket |
assignee_id | "is", "is_not" | "" (nobody assigned to the ticket), "current_user", or the numeric id of the agent assigned to the ticket |
requester_id | "is", "is_not" | "" (no requester specified), "current_user", or the numeric id of the requester or assignee |
organization_id | "is", "is_not" | "" (no organization added to the ticket) or the numeric id of the organization added to the ticket |
current_tags | "includes", "not_includes" | A space-delimited list of tags to compare against the ticket's tags |
via_id | "is", "is_not" | The numeric id of the channel used to create the ticket. See Via Types |
recipient | Omit the operator property | For views and automations, the account name in the email address from which the ticket was received. For triggers and SLA policies, the full email address, which can include external addresses |
custom_fields_{id} | "is", "is_not" | Specify the id of the custom ticket field. See Ticket fields. Possible values vary depending on the field. See Setting custom field values |
Additional conditions for ticket triggers, automations, and views
In addition to the shared conditions, ticket triggers, automations, and views share the following conditions.
field | operator | value |
---|---|---|
type | "is", "is_not" | "question", "incident", "problem", or "task" |
status | "is", "is_not", "less_than", "greater_than" | "new", "open", "pending", "hold", "solved", or "closed" |
priority | "is", "is_not", "less_than", "greater_than" | "" (no priority assigned to the ticket), "low", "normal", "high", or "urgent" |
locale_id | "is", "is_not" | The numeric id of the locale of the person who submitted the ticket. See List locales to list the available locale ids for the account |
satisfaction_score | "is", "is_not", "less_than", "greater_than", "good_with_comment", "good", "bad_with_comment", "bad", false (offered), or true (unoffered) | A satisfaction score |
brand_id | "is", "is_not", "changed", "changed_to", "changed_from", "not_changed", "not_changed_to", "not_changed_from" | One of the account's brands |
ticket_form_id | "is", "is_not", "changed", "changed_to", "changed_from", "not_changed", "not_changed_to", "not_changed_from" | One of the account's forms |
Additional conditions for ticket triggers and automations
In addition to the shared conditions, ticket triggers and automations share the following conditions.
field | operator | value |
---|---|---|
user.custom_fields.{key} | "is", "is_not", "present" (omit value), "not_present" (omit value), "includes" (contains one word), "not_includes" (contains none of the words), "includes_string" (contains string), "not_includes_string" (does not contain string) | Specify the key of the custom user field. See User fields. Possible values vary depending on the field. See user_fields in the Users API |
organization.custom_fields.{key} | "is", "is_not", "present" (omit value), "not_present" (omit value), "includes" (contains one word), "not_includes" (contains none of the words), "includes_string" (contains string), "not_includes_string" (does not contain string) | Specify the key of the custom organization field. See Organization fields. Possible values vary depending on the field. See organization_fields in the Organizations API |
Additional operators and conditions for ticket triggers
Ticket triggers have the following additional operators for some shared fields.
Fields | Additional ticket trigger operators |
---|---|
status, type, priority, group_id, assignee_id, requester_id, organization_id, satisfaction_score | "changed" (omit value property), "value" (changed to), "value_previous" (changed from), "not_changed", "not_value" (not changed to), "not_value_previous" (not changed from) |
In addition to the shared conditions, ticket triggers have the following additional conditions.
field | operator | value |
---|---|---|
subject_includes_word | "includes" (contains one word), "not_includes" (contains none of the words), "is" (contains string), "is_not" (does not contain string) | Single words or strings in the subject |
comment_includes_word | "includes" (contains one word), "not_includes" (contains none of the words), "is" (contains string), "is_not" (does not contain string) | Single words or strings in either the subject or body of the comment |
current_via_id | "is", "is_not" | The numeric id of the channel used to update the ticket. See the Via Types table |
update_type | Omit the operator property | "Create" or "Change" |
comment_is_public | Omit the operator property | true, false, "not_relevant" (present), or "requester_can_see_comment" (present and requester can see comment) |
ticket_is_public | Omit the operator property | "public", "private" |
reopens | "less_than", "greater_than", "is" | The number of times a ticket has moved from Solved to Open or Pending |
replies | "less_than", "greater_than", "is" | The number of public agent comments. |
agent_stations | "less_than", "greater_than", "is" | The number of different agents to which a ticket has been assigned |
group_stations | "less_than", "greater_than", "is" | The number of different groups to which a ticket has been assigned |
in_business_hours | Omit the operator property | true or false. Available only if an administrator enabled business hours |
requester_twitter_followers_count | "less_than", "greater_than", "is" | The number of the requester's X (formerly Twitter) followers |
requester_twitter_statuses_count | "less_than", "greater_than", "is" | The total number of the requester's tweets |
requester_twitter_verified | Omit the operator property | Omit the value property. The condition is true if the requester has a verified X account |
requester_role | "is", "is_not" | The role of the ticket requester. The role type can be "agent", "admin", or "end-user". If you're using light agents, the light agent role type is available |
attachment | Omit the operator property | The condition is true if the ticket has attachments. Both appended and inline attachments are included, with the exception of inline attachments that are added to the ticket using a macro |
cc | Omit the operator property | The condition is true if the ticket has collaborators CC'd on it. It does not check for followers or @mentions |
custom_status_id | "includes" (contains one or more ids), "not_includes" (contains none of the id), "is", "is_not", "changed" (omit value property), "value" (changed to), "value_previous" (changed from), "not_changed", "not_value" (not changed to), "not_value_previous" (not changed from) | The custom ticket status id |
lookup:ticket.ticket_field_{id}. custom_fields.{key} | "is", "is_not", "present", "not_present" | The related custom object's fields |
Additional SLA policies conditions
In addition to the shared conditions, SLA policies have the following additional conditions.
field | operator | value |
---|---|---|
ticket_type_id | "is", "is_not" | The numeric id of the ticket type: 1 (question), 2 (incident), 3 (problem), or 4 (task) |
current_via_id | "is", "is_not" | The numeric id of the channel used to update the ticket. See Via Types |
exact_created_at | "less_than", "less_than_equal", "greater_than", "greater_than_equal" | The time the ticket was created |
custom_status_id | "is", "is_not" | The custom ticket status id |
Additional time-based conditions for automations and views
Automations and views have the following time-based conditions. Time-based conditions can only be used in all
arrays, not in any
arrays.
field | value |
---|---|
NEW | Hours since the ticket was created |
OPEN | Hours since the ticket was opened |
PENDING | Hours since the ticket was changed to pending |
SOLVED | Hours since the ticket was changed to solved |
assigned_at | Hours since assigned |
updated_at | Hours since update |
requester_updated_at | Hours since requester update |
assignee_updated_at | Hours since assignee update |
due_date | Hours since the due date. For tickets with the type set to task |
until_due_date | Hours until the due date. For tickets with the type set to task |
description_includes_word | Single words or strings in the ticket subject |
The time-based conditions all share the same operator values:
operator |
---|
"is" |
"is_business_hours" |
"less_than" |
"less_than_business_hours" |
"greater_than" |
"greater_than_business_hours" |
Additional conditions for views
In addition to the shared conditions, views also have the following condition.
field | operator | value |
---|---|---|
CLOSED | "is", "is_business_hours", "less_than", "less_than_business_hours", "greater_than", "greater_than_than_business_hours" | Hours since the ticket was closed |
custom_status_id | "includes" (contains one or more ids), "not_includes" (contains none of the id) | The custom ticket status id |
Additional conditions for automations
In addition to the shared conditions, automations also have the following condition.
field | operator | value |
---|---|---|
custom_status_id | "is", "is_not" | The custom ticket status id |
Conditions for object triggers
The conditions available for each object trigger vary based on the types of fields defined for the object.
field | operator | value |
---|---|---|
text | "is", "is_not", "present", "not_present", "includes_words", "not_includes_words", "includes_string", "not_includes_string" | Enter any text-based value. |
textarea | "is", "is_not", "present", "not_present", "includes_words", "not_includes_words", "includes_string", "not_includes_string" | Enter any text-based value. |
checkbox | "is" | Select True or False. |
date | "is", "is_not", "present", "not_present", "less_than", "less_than_equal", "greater_than", "greater_than_equal", "within_previous_n_days", "within_next_n_days" | Select a date or enter a whole number of days. |
integer | "is", "is_not", "present", "not_present", "less_than", "greater_than", "less_than_equal", "greater_than_equal" | Enter a numeric value. |
decimal | "is", "is_not", "less_than", "less_than_equal", "greater_than", "greater_than_equal", "present", "not_present" | Enter any decimal value. |
regexp | "is", "is_not", "present", "not_present", "includes_words", "not_includes_words", "includes_string", "not_includes_string" | Enter any value. |
dropdown | "is", "is_not", "present", "not_present" | Select from the field's options. |
lookup | "is", "is_not", "present", "not_present" | Select from records of that target object. You can also refer to the related record's fields with placeholders. |
multiselect | "includes", "not_includes", "present", "not_present" | Select from the field's options. |