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 if trigger_type is “manual”.
html_urlstring (url)a URL at which the entity is uniquely displayed in the Web app
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
trigger_urlstring (url)
typestring
workflowobjectWorkflow to start when this trigger is invoked

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_incident_workflow_triggerselectidAccept, Content-TypeRetrieve an existing Incident Workflows Trigger

Scoped OAuth requires: incident_workflows.read
list_incident_workflow_triggersselectAccept, Content-Type, workflow_id, incident_id, service_id, trigger_type, sort_by, limit, cursorList existing Incident Workflow Triggers

Scoped OAuth requires: incident_workflows.read
create_incident_workflow_triggerinsertdata__triggerAccept, Content-TypeCreate new Incident Workflow Trigger

Scoped OAuth requires: incident_workflows.write
delete_service_from_incident_workflow_triggerdeletetrigger_id, service_idAccept, Content-TypeRemove a an existing Service from an Incident Workflow Trigger

Scoped OAuth requires: incident_workflows.write
delete_incident_workflow_triggerdeleteidAccept, Content-TypeDelete an existing Incident Workflow Trigger

Scoped OAuth requires: incident_workflows.write
_list_incident_workflow_triggersexecAccept, Content-Type, workflow_id, incident_id, service_id, trigger_type, sort_by, limit, cursorList existing Incident Workflow Triggers

Scoped OAuth requires: incident_workflows.read
_get_incident_workflow_triggerexecidAccept, Content-TypeRetrieve an existing Incident Workflows Trigger

Scoped OAuth requires: incident_workflows.read
update_incident_workflow_triggerexecid, triggerAccept, Content-TypeUpdate an existing Incident Workflow Trigger

Scoped OAuth requires: incident_workflows.write
associate_service_to_incident_workflow_triggerexecid, serviceAccept, Content-TypeAssociate a Service with an existing Incident Workflow Trigger

Scoped OAuth requires: incident_workflows.write

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.
service_idstringIdentifier for the Service
trigger_idstringIdentifier for the Trigger
AcceptstringThe Accept header is used as a versioning header.
Content-Typestring
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.
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

SELECT examples

Retrieve an existing Incident Workflows Trigger

Scoped OAuth requires: incident_workflows.read

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

INSERT examples

Create new Incident Workflow Trigger

Scoped OAuth requires: incident_workflows.write

INSERT INTO pagerduty.incident_workflows.triggers (
data__trigger,
Accept,
Content-Type
)
SELECT
'{{ trigger }}' /* required */,
'{{ Accept }}',
'{{ Content-Type }}'
RETURNING
trigger
;

DELETE examples

Remove a an existing Service from an Incident Workflow Trigger

Scoped OAuth requires: incident_workflows.write

DELETE FROM pagerduty.incident_workflows.triggers
WHERE trigger_id = '{{ trigger_id }}' --required
AND service_id = '{{ service_id }}' --required
AND Accept = '{{ Accept }}'
AND Content-Type = '{{ Content-Type }}'
;

Lifecycle Methods

List existing Incident Workflow Triggers

Scoped OAuth requires: incident_workflows.read

EXEC pagerduty.incident_workflows.triggers._list_incident_workflow_triggers 
@Accept='{{ Accept }}',
@Content-Type='{{ Content-Type }}',
@workflow_id='{{ workflow_id }}',
@incident_id='{{ incident_id }}',
@service_id='{{ service_id }}',
@trigger_type='{{ trigger_type }}',
@sort_by='{{ sort_by }}',
@limit='{{ limit }}',
@cursor='{{ cursor }}'
;