triggers
Creates, updates, deletes, gets or lists a triggers
resource.
Overview
Name | triggers |
Type | Resource |
Id | pagerduty.incident_workflows.triggers |
Fields
The following fields are returned by SELECT
queries:
- get_incident_workflow_trigger
- list_incident_workflow_triggers
The Incident Workflows Trigger
Name | Datatype | Description |
---|---|---|
id | string | |
trigger_type_name | string | Human readable name for the trigger type |
condition | string | A 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_url | string (url) | a URL at which the entity is uniquely displayed in the Web app |
is_subscribed_to_all_services | boolean | Indicates that the Trigger should be associated with All Services |
permissions | object | An object detailing who can start this Trigger. Applicable only to manual Triggers. |
self | string (url) | the API show URL at which the object is accessible |
services | array | An optional array of Services associated with this workflow. Incidents in any of the listed Services are eligible to fire this Trigger |
summary | string | A 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_type | string | |
trigger_url | string (url) | |
type | string | |
workflow | object | Workflow to start when this trigger is invoked |
A paginated array of Incident Workflow Triggers
Name | Datatype | Description |
---|---|---|
id | string | |
trigger_type_name | string | Human readable name for the trigger type |
condition | string | A 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_url | string (url) | a URL at which the entity is uniquely displayed in the Web app |
is_subscribed_to_all_services | boolean | Indicates that the Trigger should be associated with All Services |
permissions | object | An object detailing who can start this Trigger. Applicable only to manual Triggers. |
self | string (url) | the API show URL at which the object is accessible |
services | array | An optional array of Services associated with this workflow. Incidents in any of the listed Services are eligible to fire this Trigger |
summary | string | A 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_type | string | |
trigger_url | string (url) | |
type | string | |
workflow | object | Workflow to start when this trigger is invoked |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get_incident_workflow_trigger | select | id | Accept , Content-Type | Retrieve an existing Incident Workflows Trigger Scoped OAuth requires: incident_workflows.read |
list_incident_workflow_triggers | select | Accept , Content-Type , workflow_id , incident_id , service_id , trigger_type , sort_by , limit , cursor | List existing Incident Workflow Triggers Scoped OAuth requires: incident_workflows.read | |
create_incident_workflow_trigger | insert | data__trigger | Accept , Content-Type | Create new Incident Workflow Trigger Scoped OAuth requires: incident_workflows.write |
delete_service_from_incident_workflow_trigger | delete | trigger_id , service_id | Accept , Content-Type | Remove a an existing Service from an Incident Workflow Trigger Scoped OAuth requires: incident_workflows.write |
delete_incident_workflow_trigger | delete | id | Accept , Content-Type | Delete an existing Incident Workflow Trigger Scoped OAuth requires: incident_workflows.write |
_list_incident_workflow_triggers | exec | Accept , Content-Type , workflow_id , incident_id , service_id , trigger_type , sort_by , limit , cursor | List existing Incident Workflow Triggers Scoped OAuth requires: incident_workflows.read | |
_get_incident_workflow_trigger | exec | id | Accept , Content-Type | Retrieve an existing Incident Workflows Trigger Scoped OAuth requires: incident_workflows.read |
update_incident_workflow_trigger | exec | id , trigger | Accept , Content-Type | Update an existing Incident Workflow Trigger Scoped OAuth requires: incident_workflows.write |
associate_service_to_incident_workflow_trigger | exec | id , service | Accept , Content-Type | Associate 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.
Name | Datatype | Description |
---|---|---|
id | string | The ID of the resource. |
service_id | string | Identifier for the Service |
trigger_id | string | Identifier for the Trigger |
Accept | string | The Accept header is used as a versioning header. |
Content-Type | string | |
cursor | string | Optional 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_id | string | If 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. |
limit | integer | The minimum of the limit parameter used in the request or the maximum request size of the API. |
service_id | string | If 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_by | string | If provided, returns triggers sorted by the specified property. |
trigger_type | string | If provided, only show triggers of the given type. For example “manual” to search for manual triggers |
workflow_id | string | If provided, only show triggers configured to start the given workflow. Useful for listing all services associated with the given workflow |
SELECT
examples
- get_incident_workflow_trigger
- list_incident_workflow_triggers
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 }}'
;
List existing Incident Workflow Triggers
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 Accept = '{{ Accept }}'
AND Content-Type = '{{ Content-Type }}'
AND workflow_id = '{{ workflow_id }}'
AND incident_id = '{{ incident_id }}'
AND service_id = '{{ service_id }}'
AND trigger_type = '{{ trigger_type }}'
AND sort_by = '{{ sort_by }}'
AND limit = '{{ limit }}'
AND cursor = '{{ cursor }}'
;
INSERT
examples
- create_incident_workflow_trigger
- Manifest
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
;
# Description fields are for documentation purposes
- name: triggers
props:
- name: trigger
value: object
- name: Accept
value: string
description: The `Accept` header is used as a versioning header.
- name: Content-Type
value: string
DELETE
examples
- delete_service_from_incident_workflow_trigger
- delete_incident_workflow_trigger
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 }}'
;
Delete an existing Incident Workflow Trigger
Scoped OAuth requires: incident_workflows.write
DELETE FROM pagerduty.incident_workflows.triggers
WHERE id = '{{ id }}' --required
AND Accept = '{{ Accept }}'
AND Content-Type = '{{ Content-Type }}'
;
Lifecycle Methods
- _list_incident_workflow_triggers
- _get_incident_workflow_trigger
- update_incident_workflow_trigger
- associate_service_to_incident_workflow_trigger
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 }}'
;
Retrieve an existing Incident Workflows Trigger
Scoped OAuth requires: incident_workflows.read
EXEC pagerduty.incident_workflows.triggers._get_incident_workflow_trigger
@id='{{ id }}' --required,
@Accept='{{ Accept }}',
@Content-Type='{{ Content-Type }}'
;
Update an existing Incident Workflow Trigger
Scoped OAuth requires: incident_workflows.write
EXEC pagerduty.incident_workflows.triggers.update_incident_workflow_trigger
@id='{{ id }}' --required,
@Accept='{{ Accept }}',
@Content-Type='{{ Content-Type }}'
@@json=
'{
"trigger": "{{ trigger }}"
}'
;
Associate a Service with an existing Incident Workflow Trigger
Scoped OAuth requires: incident_workflows.write
EXEC pagerduty.incident_workflows.triggers.associate_service_to_incident_workflow_trigger
@id='{{ id }}' --required,
@Accept='{{ Accept }}',
@Content-Type='{{ Content-Type }}'
@@json=
'{
"service": "{{ service }}"
}'
;