Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
466d58b3d2 | ||
![]() |
c0f0415f70 |
@@ -0,0 +1,25 @@
|
||||
import defineAction from '../../../../helpers/define-action.js';
|
||||
|
||||
export default defineAction({
|
||||
name: 'Find incident',
|
||||
key: 'findIncident',
|
||||
description: 'finds an incident.',
|
||||
arguments: [
|
||||
{
|
||||
label: 'Incident ID',
|
||||
key: 'incidentId',
|
||||
type: 'string',
|
||||
required: true,
|
||||
variables: true,
|
||||
description: 'ID for querying incidents.',
|
||||
},
|
||||
],
|
||||
|
||||
async run($) {
|
||||
const incidentId = $.step.parameters.incidentId;
|
||||
|
||||
const response = await $.http.get(`/v2/incidents/${incidentId}`);
|
||||
|
||||
$.setActionItem({ raw: response.data.data });
|
||||
},
|
||||
});
|
@@ -1,4 +1,11 @@
|
||||
import acknowledgeIncident from './acknowledge-incident/index.js';
|
||||
import createIncident from './create-incident/index.js';
|
||||
import findIncident from './find-incident/index.js';
|
||||
import resolveIncident from './resolve-incident/index.js';
|
||||
|
||||
export default [acknowledgeIncident, createIncident];
|
||||
export default [
|
||||
acknowledgeIncident,
|
||||
createIncident,
|
||||
findIncident,
|
||||
resolveIncident,
|
||||
];
|
||||
|
@@ -0,0 +1,43 @@
|
||||
import defineAction from '../../../../helpers/define-action.js';
|
||||
|
||||
export default defineAction({
|
||||
name: 'Resolve incident',
|
||||
key: 'resolveIncident',
|
||||
description: 'Resolves an incident.',
|
||||
arguments: [
|
||||
{
|
||||
label: 'Incident ID',
|
||||
key: 'incidentId',
|
||||
type: 'string',
|
||||
required: true,
|
||||
variables: true,
|
||||
description:
|
||||
'This represents the identification for an incident that requires resolution.',
|
||||
},
|
||||
{
|
||||
label: 'Resolved by',
|
||||
key: 'resolvedBy',
|
||||
type: 'string',
|
||||
required: false,
|
||||
variables: true,
|
||||
description:
|
||||
"This refers to the individual's name, email, or another form of identification that the person who resolved the incident has provided.",
|
||||
},
|
||||
],
|
||||
|
||||
async run($) {
|
||||
const resolvedBy = $.step.parameters.resolvedBy;
|
||||
const incidentId = $.step.parameters.incidentId;
|
||||
|
||||
const body = {
|
||||
resolved_by: resolvedBy,
|
||||
};
|
||||
|
||||
const response = await $.http.post(
|
||||
`/v2/incidents/${incidentId}/resolve`,
|
||||
body
|
||||
);
|
||||
|
||||
$.setActionItem({ raw: response.data.data });
|
||||
},
|
||||
});
|
@@ -5,6 +5,10 @@ items:
|
||||
desc: Acknowledges an incident.
|
||||
- name: Create incident
|
||||
desc: Creates an incident that informs the team.
|
||||
- name: Find incident
|
||||
desc: Finds an incident.
|
||||
- name: Resolve incident
|
||||
desc: Resolves an incident.
|
||||
---
|
||||
|
||||
<script setup>
|
||||
|
Reference in New Issue
Block a user