turbot/zendesk

steampipe plugin install zendesksteampipe plugin install zendesk

Table: zendesk_trigger

A trigger consists of one or more actions performed when a ticket is created or updated. The actions are performed only if certain conditions are met. For example, a trigger can notify the customer when an agent changes the status of a ticket to Solved.

Examples

List triggers in order

select
position,
title
from
zendesk_trigger
where
active
order by
position;

List all inactive triggers

select
title
from
zendesk_trigger
where
not active;

Find triggers that only work on high priority tickets

Triggers include both all (conditions_all) and any (conditions_any) fields. Read more here.

This test checks if conditions_all requires the ticket to be in a high priority for the trigger to run. We rely on JSON submatching in postgres to find the condition among the array.

select
title,
conditions_all
from
zendesk_trigger
where
conditions_all @> '[{"field":"priority","operator":"value","value":"high"}]';

Expand the actions for each trigger

select
title,
jsonb_path_query(actions, '$[*].field') as actions,
jsonb_path_query(actions, '$[*].value')
from
zendesk_trigger;

.inspect zendesk_trigger

A trigger consists of one or more actions performed when a ticket is created or updated. The actions are performed only if certain conditions are met. For example, a trigger can notify the customer when an agent changes the status of a ticket to Solved.

NameTypeDescription
actionsjsonbAn array of actions describing what the trigger will do.
activebooleanWhether the trigger is active
conditions_alljsonbTrigger if all conditions are met.
conditions_anyjsonbTrigger if any condition is met.
created_attimestamp without time zoneThe time the trigger was created
descriptiontextThe description of the trigger
idbigintAutomatically assigned when the trigger is created
positionbigintPosition of the trigger, determines the order they will execute in.
titletextThe title of the trigger
updated_attimestamp without time zoneThe time of the last update of the trigger