-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto send an outgoing webhook on incident archive #17310
Comments
Can I work on this? |
Of course! Thank you for the interest, @hakansa! Feel free to get in touch if you need help with anything :) |
@agarciamontoro Thanks! I've started to updates on backend side. I have some questions;
|
Hi @hakansa!
That's expected, you cannot use the plugin without an E20 license. However, contributing to it is still encouraged, so you can bypass this restriction locally by enabling testing commands and developer mode: you need to go to System Console and, under Environment, click on Developer. There, you should set the following settings to true, as shown in the screenshot:
I understand you mean the automation tab for the playbook, right? That's on the incident collaboration backstage. To access that (after you have configured the system console as described above), you need to go to the hamburger menu, and click on Incident Collaboration: Then go to the Playbooks tab, create one playbook and click on the Automation tab: Does this answer your questions? |
@agarciamontoro thanks for comprehensive answer. It answers all of my questions. |
Hi @agarciamontoro, |
You can add a new test function, no problem! It should be similar in structure to I hope this helps, but don't hesitate to ask for anything else if you still have doubts, I know it's a lot of info! |
@agarciamontoro very thanks for your help! I added the test function and created a PR: mattermost/mattermost-plugin-playbooks#526 |
This is a ticket for the Incident Collaboration plugin.
Add a new setting to the automation tab in the backstage to configure a new outgoing webhook, and send the outgoing webhook when the incident status is updated to Archived.
This should be fairly similar to the work done in mattermost/mattermost-plugin-playbooks#503, except the webhook is sent inside the
UpdateStatus
function, when the new status is successfully updated toArchived
.Backend work
1. On the
IR_Playbook
table, add:WebhookOnArchiveURL
WebhookOnArchiveEnabled
.1. On the IR_Incident table, add:
WebhookOnArchiveURL
.Playbook
andIncident
types. This will break some of the tests, so make sure to runmake test
and update the ones that are failing.createIncident
function, copy theWebhookOnArchiveURL
field from the playbook to the incident, only if the playbook’sWebhookOnArchiveEnabled
is true.createPlaybook
andupdatePlaybook
functions, make sure that the string passed inWebhookOnCreationURL
is a valid URL, and return ahttp.StatusBadRequest
if it is not.UpdateStatus
function, when the status is successfully updated toArchived
, make a POST request to the webhook URL with a payload equal to the one sent with the on creation webhook. Take a look at thesendWebhookOnCreation
function for inspiration on how to do it.Frontend work
Playbook
type with the new fields added to the data model in the server.WebhookOnArchive
, very similar toWebhookOnCreation
(check if it could be reused, maybe there is no need to write a brand new component).AutomationSettings
component to add a newSetting
to the section “When an incident is archived” (create the section if it does not exist yet), that includes the newWebhookOnArchive
component. You will need to update the props to receive the new values and functions that theWebhookOnArchive
component will need.PlaybookEdit
component, create the necessary functions to handle change and toggle of the newWebhookOnArchive
component, and pass those functions and the corresponding values to theAutomationSettings
componentTesting and documentation
Archived
.If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.
New contributors please see our Developer's Guide.
JIRA: https://mattermost.atlassian.net/browse/MM-32419
The text was updated successfully, but these errors were encountered: