2022-08-17 08:50:24 -07:00
import { INodeProperties } from 'n8n-workflow' ;
2020-04-05 18:06:23 -07:00
2021-12-03 00:44:16 -08:00
export const incidentOperations : INodeProperties [ ] = [
2020-04-05 18:06:23 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-04-05 18:06:23 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'incident' ] ,
2020-04-05 18:06:23 -07:00
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
description : 'Create an incident' ,
2022-07-10 13:50:51 -07:00
action : 'Create an incident' ,
2020-04-05 18:06:23 -07:00
} ,
{
name : 'Get' ,
value : 'get' ,
description : 'Get an incident' ,
2022-07-10 13:50:51 -07:00
action : 'Get an incident' ,
2020-04-05 18:06:23 -07:00
} ,
{
2022-09-07 07:51:14 -07:00
name : 'Get Many' ,
2020-04-05 18:06:23 -07:00
value : 'getAll' ,
2022-09-13 03:36:36 -07:00
description : 'Get many incidents' ,
2022-09-08 08:10:13 -07:00
action : 'Get many incidents' ,
2020-04-05 18:06:23 -07:00
} ,
{
name : 'Update' ,
value : 'update' ,
description : 'Update an incident' ,
2022-07-10 13:50:51 -07:00
action : 'Update an incident' ,
2020-04-05 18:06:23 -07:00
} ,
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-04-05 18:06:23 -07:00
2021-12-03 00:44:16 -08:00
export const incidentFields : INodeProperties [ ] = [
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* incident:create */
/* -------------------------------------------------------------------------- */
2020-04-05 18:06:23 -07:00
{
displayName : 'Title' ,
name : 'title' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'incident' ] ,
operation : [ 'create' ] ,
2020-04-05 18:06:23 -07:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'A succinct description of the nature, symptoms, cause, or effect of the incident' ,
2020-04-05 18:06:23 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Service Name or ID' ,
2020-04-05 18:06:23 -07:00
name : 'serviceId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getServices' ,
} ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'incident' ] ,
operation : [ 'create' ] ,
2020-04-05 18:06:23 -07:00
} ,
} ,
2022-08-17 08:50:24 -07:00
description :
'The incident will be created on this service. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2020-04-05 18:06:23 -07:00
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'incident' ] ,
operation : [ 'create' ] ,
2020-04-05 18:06:23 -07:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The email address of a valid user associated with the account making the request' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'incident' ] ,
operation : [ 'create' ] ,
2020-04-05 18:06:23 -07:00
} ,
} ,
default : { } ,
options : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Escalation Policy Name or ID' ,
2020-04-05 18:06:23 -07:00
name : 'escalationPolicyId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getEscalationPolicies' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Delegate this incident to the specified escalation policy. Cannot be specified if an assignee is given. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-05 18:06:23 -07:00
} ,
2022-04-15 01:36:02 -07:00
{
displayName : 'Incident Details' ,
name : 'details' ,
type : 'string' ,
default : '' ,
description : 'Additional details about the incident which will go in the body' ,
} ,
2020-04-05 18:06:23 -07:00
{
displayName : 'Incident Key' ,
name : 'incidentKey' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Sending subsequent requests referencing the same service and with the same incident_key will result in those requests being rejected if an open incident matches that incident_key' ,
2020-04-05 18:06:23 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Priority Name or ID' ,
2020-04-05 18:06:23 -07:00
name : 'priorityId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getPriorities' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The incident will be created on this service. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Urgency' ,
name : 'urgency' ,
type : 'options' ,
options : [
{
name : 'Hight' ,
value : 'high' ,
} ,
{
name : 'Low' ,
value : 'low' ,
} ,
] ,
default : '' ,
description : 'The urgency of the incident' ,
} ,
] ,
} ,
{
displayName : 'Conference Bridge' ,
name : 'conferenceBridgeUi' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : false ,
} ,
placeholder : 'Add Conference Bridge' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'incident' ] ,
operation : [ 'create' ] ,
2020-04-05 18:06:23 -07:00
} ,
} ,
default : { } ,
options : [
{
displayName : 'Conference Bridge' ,
name : 'conferenceBridgeValues' ,
values : [
{
displayName : 'Conference Number' ,
name : 'conferenceNumber' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Phone numbers should be formatted like +1 415-555-1212,,,,1234#, where a comma (,) represents a one-second wait and pound (#) completes access code input' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Conference URL' ,
name : 'conferenceUrl' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'An URL for the conference bridge. This could be a link to a web conference or Slack channel.' ,
2020-10-22 06:46:03 -07:00
} ,
2020-04-05 18:06:23 -07:00
] ,
} ,
] ,
} ,
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* incident:get */
/* -------------------------------------------------------------------------- */
2020-04-05 18:06:23 -07:00
{
displayName : 'Incident ID' ,
name : 'incidentId' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'incident' ] ,
operation : [ 'get' ] ,
2020-04-05 18:06:23 -07:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Unique identifier for the incident' ,
2020-04-05 18:06:23 -07:00
} ,
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* incident:getAll */
/* -------------------------------------------------------------------------- */
2020-04-05 18:06:23 -07:00
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'getAll' ] ,
resource : [ 'incident' ] ,
2020-04-05 18:06:23 -07:00
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'getAll' ] ,
resource : [ 'incident' ] ,
returnAll : [ false ] ,
2020-04-05 18:06:23 -07:00
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 500 ,
} ,
default : 100 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Options' ,
name : 'options' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'incident' ] ,
operation : [ 'getAll' ] ,
2020-04-05 18:06:23 -07:00
} ,
} ,
options : [
{
displayName : 'Date Range' ,
name : 'dateRange' ,
type : 'options' ,
options : [
{
name : 'All' ,
value : 'all' ,
} ,
] ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'When set to all, the since and until parameters and defaults are ignored' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Incident Key' ,
name : 'incidentKey' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Incident de-duplication key. Incidents with child alerts do not have an incident key; querying by incident key will return incidents whose alerts have alert_key matching the given incident key.' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Include' ,
name : 'include' ,
type : 'multiOptions' ,
options : [
{
name : 'Acknowledgers' ,
value : 'acknowledgers' ,
} ,
2022-06-20 07:54:01 -07:00
{
name : 'Assignees' ,
value : 'assigness' ,
} ,
2020-04-05 18:06:23 -07:00
{
name : 'Conferenece Bridge' ,
value : 'conferenceBridge' ,
} ,
{
name : 'Escalation Policies' ,
value : 'escalationPolicies' ,
} ,
{
name : 'First Trigger Log Entries' ,
value : 'firstTriggerLogEntries' ,
} ,
{
name : 'Priorities' ,
value : 'priorities' ,
} ,
{
name : 'Services' ,
value : 'services' ,
} ,
{
name : 'Teams' ,
value : 'teams' ,
} ,
{
name : 'Users' ,
value : 'users' ,
} ,
] ,
default : [ ] ,
2022-05-06 14:01:25 -07:00
description : 'Additional details to include' ,
2020-04-05 18:06:23 -07:00
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Service Names or IDs' ,
2020-04-05 18:06:23 -07:00
name : 'serviceIds' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getServices' ,
} ,
2022-04-22 09:29:51 -07:00
default : [ ] ,
2022-08-17 08:50:24 -07:00
description :
'Returns only the incidents associated with the passed service(s). Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Since' ,
name : 'since' ,
type : 'dateTime' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The start of the date range over which you want to search. (the limit on date ranges is 6 months).' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Sort By' ,
name : 'sortBy' ,
type : 'string' ,
default : '' ,
placeholder : 'created_at:asc,resolved_at:desc' ,
2022-08-17 08:50:24 -07:00
description :
'Used to specify both the field you wish to sort the results on (incident_number/created_at/resolved_at/urgency), as well as the direction (asc/desc) of the results. The sort_by field and direction should be separated by a colon. A maximum of two fields can be included, separated by a comma.' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Statuses' ,
name : 'statuses' ,
type : 'multiOptions' ,
options : [
{
name : 'Acknowledged' ,
value : 'acknowledged' ,
} ,
{
name : 'Resolved' ,
value : 'resolved' ,
} ,
{
name : 'Triggered' ,
value : 'triggered' ,
} ,
] ,
2022-04-22 09:29:51 -07:00
default : [ ] ,
2022-05-06 14:01:25 -07:00
description : 'Returns only the incidents associated with the passed service(s)' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Team IDs' ,
name : 'teamIds' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Team IDs. Only results related to these teams will be returned. Account must have the teams ability to use this parameter. (multiples IDs can be added separated by comma)' ,
2020-04-05 18:06:23 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Timezone Name or ID' ,
2020-04-05 18:06:23 -07:00
name : 'timeZone' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getTimezones' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Time zone in which dates in the result will be rendered. If not set dates will return UTC. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Until' ,
name : 'until' ,
type : 'dateTime' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The end of the date range over which you want to search. (the limit on date ranges is 6 months).' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Urgencies' ,
name : 'urgencies' ,
type : 'multiOptions' ,
options : [
{
name : 'High' ,
value : 'high' ,
} ,
{
name : 'Low' ,
value : 'low' ,
} ,
] ,
2022-04-22 09:29:51 -07:00
default : [ ] ,
2022-08-17 08:50:24 -07:00
description :
'Urgencies of the incidents to be returned. Defaults to all urgencies. Account must have the urgencies ability to do this' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'User IDs' ,
name : 'userIds' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Returns only the incidents currently assigned to the passed user(s). This expects one or more user IDs (multiple IDs can be added separated by comma).' ,
2020-04-05 18:06:23 -07:00
} ,
] ,
} ,
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* incident:update */
/* -------------------------------------------------------------------------- */
2020-04-05 18:06:23 -07:00
{
displayName : 'Incident ID' ,
name : 'incidentId' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'incident' ] ,
operation : [ 'update' ] ,
2020-04-05 18:06:23 -07:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Unique identifier for the incident' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2020-04-05 18:06:23 -07:00
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'incident' ] ,
operation : [ 'update' ] ,
2020-04-05 18:06:23 -07:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The email address of a valid user associated with the account making the request' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'incident' ] ,
operation : [ 'update' ] ,
2020-04-05 18:06:23 -07:00
} ,
} ,
default : { } ,
options : [
{
displayName : 'Escalation Level' ,
name : 'escalationLevel' ,
type : 'number' ,
default : 0 ,
typeOptions : {
minValue : 0 ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Escalate the incident to this level in the escalation policy' ,
2020-04-05 18:06:23 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Escalation Policy Name or ID' ,
2020-04-05 18:06:23 -07:00
name : 'escalationPolicyId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getEscalationPolicies' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Delegate this incident to the specified escalation policy. Cannot be specified if an assignee is given. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-05 18:06:23 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Priority Name or ID' ,
2020-04-05 18:06:23 -07:00
name : 'priorityId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getPriorities' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The incident will be created on this service. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Resolution' ,
name : 'resolution' ,
type : 'string' ,
typeOptions : {
alwaysOpenEditWindow : true ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The resolution for this incident if status is set to resolved' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Status' ,
name : 'status' ,
type : 'options' ,
options : [
{
name : 'Acknowledged' ,
value : 'acknowledged' ,
} ,
{
name : 'Resolved' ,
value : 'resolved' ,
} ,
] ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The new status of the incident' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Title' ,
name : 'title' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'A succinct description of the nature, symptoms, cause, or effect of the incident' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Urgency' ,
name : 'urgency' ,
type : 'options' ,
options : [
{
name : 'Hight' ,
value : 'high' ,
} ,
{
name : 'Low' ,
value : 'low' ,
} ,
] ,
default : '' ,
description : 'The urgency of the incident' ,
} ,
] ,
} ,
{
displayName : 'Conference Bridge' ,
name : 'conferenceBridgeUi' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : false ,
} ,
placeholder : 'Add Conference Bridge' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'incident' ] ,
operation : [ 'update' ] ,
2020-04-05 18:06:23 -07:00
} ,
} ,
default : { } ,
options : [
{
displayName : 'Conference Bridge' ,
name : 'conferenceBridgeValues' ,
values : [
{
displayName : 'Conference Number' ,
name : 'conferenceNumber' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Phone numbers should be formatted like +1 415-555-1212,,,,1234#, where a comma (,) represents a one-second wait and pound (#) completes access code input' ,
2020-04-05 18:06:23 -07:00
} ,
{
displayName : 'Conference URL' ,
name : 'conferenceUrl' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'An URL for the conference bridge. This could be a link to a web conference or Slack channel.' ,
2020-10-22 06:46:03 -07:00
} ,
2020-04-05 18:06:23 -07:00
] ,
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;