Skip to main content

triggers

Creates, updates, deletes, gets or lists a triggers resource.

Overview

Nametriggers
TypeResource
Idpagerduty.incident_workflows.triggers

Fields

The following fields are returned by SELECT queries:

The Incident Workflows Trigger

NameDatatypeDescription
idstring
trigger_type_namestringHuman readable name for the trigger type
conditionstringA PCL condition string. If specified, the trigger will execute when the condition is met on an incident. If unspecified, the trigger will execute on incident creation. Required if trigger_type is “conditional”, not allowed for other trigger types.
html_urlstring (url)a URL at which the entity is uniquely displayed in the Web app
incident_typesarrayAn optional array of Incident Types associated with the trigger when it is of type incident_type.
is_disabledbooleanIndicates whether the Trigger is disabled or not. Inherited from the "is_enabled" property on the workflow to which this trigger belongs. This attribute is deprecated, and will be removed in a future version of this API.
is_subscribed_to_all_servicesbooleanIndicates that the Trigger should be associated with All Services
permissionsobjectAn object detailing who can start this Trigger. Applicable only to manual Triggers.
selfstring (url)the API show URL at which the object is accessible
servicesarrayAn optional array of Services associated with this workflow. Incidents in any of the listed Services are eligible to fire this Trigger
summarystringA short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to name, though it is not intended to be an identifier.
trigger_typestring (conditional, manual, incident_type)
trigger_urlstring (url)
typestringA string that determines the schema of the object. This must be the standard name for the entity, suffixed by _reference if the object is a reference.
workflowobjectWorkflow to start when this trigger is invoked

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectidRetrieve an existing Incident Workflows Trigger<br /><br />Scoped OAuth requires: incident_workflows.read<br />
listselectworkflow_id, incident_id, service_id, trigger_type, workflow_name_contains, is_disabled, sort_by, limit, cursorList existing Incident Workflow Triggers<br /><br />Scoped OAuth requires: incident_workflows.read<br />
createinserttriggerCreate new Incident Workflow Trigger<br /><br />Scoped OAuth requires: incident_workflows.write<br />
updateupdateid, triggerUpdate an existing Incident Workflow Trigger<br /><br />Scoped OAuth requires: incident_workflows.write<br />
deletedeleteidDelete an existing Incident Workflow Trigger<br /><br />Scoped OAuth requires: incident_workflows.write<br />

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
idstringThe ID of the resource.
cursorstringOptional parameter used to request the "next" set of results from an API. The value provided here is most commonly obtained from the next_cursor field of the previous request. When no value is provided, the request starts at the beginning of the result set.
incident_idstringIf provided, only show triggers configured on the service of the given incident. Useful for finding manual triggers that are configured on the service for a specific incident. Cannot be specified if service_id is provided.
is_disabledbooleanIf provided, filters between disabled and enabled Triggers. This query parameter is deprecated, and will be removed in a future version of this API.
limitintegerThe minimum of the limit parameter used in the request or the maximum request size of the API.
service_idstringIf provided, only show triggers configured for incidents in the given service. Useful for listing all workflows associated with the given service. Cannot be specified if incident_id is provided.
sort_bystringIf provided, returns triggers sorted by the specified property.
trigger_typestringIf provided, only show triggers of the given type. For example “manual” to search for manual triggers
workflow_idstringIf provided, only show triggers configured to start the given workflow. Useful for listing all services associated with the given workflow
workflow_name_containsstringIf provided, only show triggers configured to start workflows whose name contain the provided value.

SELECT examples

Retrieve an existing Incident Workflows Trigger<br /><br />Scoped OAuth requires: incident_workflows.read<br />

SELECT
id,
trigger_type_name,
condition,
html_url,
incident_types,
is_disabled,
is_subscribed_to_all_services,
permissions,
self,
services,
summary,
trigger_type,
trigger_url,
type,
workflow
FROM pagerduty.incident_workflows.triggers
WHERE id = '{{ id }}' -- required
;

INSERT examples

Create new Incident Workflow Trigger<br /><br />Scoped OAuth requires: incident_workflows.write<br />

INSERT INTO pagerduty.incident_workflows.triggers (
trigger
)
SELECT
'{{ trigger }}' /* required */
RETURNING
trigger
;

UPDATE examples

Update an existing Incident Workflow Trigger<br /><br />Scoped OAuth requires: incident_workflows.write<br />

UPDATE pagerduty.incident_workflows.triggers
SET
trigger = '{{ trigger }}'
WHERE
id = '{{ id }}' --required
AND trigger = '{{ trigger }}' --required
RETURNING
trigger;

DELETE examples

Delete an existing Incident Workflow Trigger<br /><br />Scoped OAuth requires: incident_workflows.write<br />

DELETE FROM pagerduty.incident_workflows.triggers
WHERE id = '{{ id }}' --required
;