1. Opening Problem Statement
Meet Sarah, a DevOps engineer responsible for managing incidents in her company’s IT infrastructure. Every time an incident is resolved in PagerDuty, she also has to manually update the corresponding ticket status in Jira and notify the team in Mattermost chat channels. This repetitive task takes Sarah at least 20 minutes per incident, and mistakes in communication sometimes cause confusion, delaying follow-up work and impacting the team’s productivity.
Imagine handling dozens of incidents per week: those 20 minutes add up to hours lost, and the risk of human error grows with the pressure. Sarah wants to automate these tedious updates to save time, reduce errors, and keep her team perfectly synchronized without lifting a finger.
2. What This Automation Does
This n8n workflow automates the entire incident resolution update process by connecting PagerDuty, Jira, and Mattermost. Here’s what happens when this workflow triggers:
- Receives a webhook POST from the incident system containing the incident and related issue details.
- Automatically updates the status of the PagerDuty incident to “resolved.”
- Changes the status of the linked Jira issue to “Done” (status ID 31 in Jira).
- Sends a notification message to the Mattermost channel from which the webhook originated, confirming the issue closure.
- Sends a celebratory Mattermost message to a dedicated ‘on-call’ team channel, announcing the incident resolution.
By automating these steps, Sarah and her team save at least 30 minutes per incident, reduce communication errors, and keep everyone on the same page seamlessly.
3. Prerequisites ⚙️
- n8n account to build and run the workflow.
- PagerDuty account with API credentials.
- Jira Cloud account with API access and project permissions.
- Mattermost account integrated with API credentials.
- Webhook endpoint URL generated by n8n for receiving incident data.
- Optional: Self-hosting n8n instance (For example, Hostinger: https://buldrr.com/hostinger) for full control and security.
4. Step-by-Step Guide
Step 1: Create the Webhook node to receive incident data
Go to your n8n editor, click + Add Node → search and select Webhook. Set the HTTP method to POST and assign a unique path (e.g., 1bd40693-c7dd-43f5-97d9-6d8986e62fc1 as in this example). This URL will be where PagerDuty or your incident system sends data on incident closure.
After saving, copy the generated URL and use it in your PagerDuty webhook or integration settings to send incident updates to n8n.
Common mistake: Do not forget to set the method to POST or the webhook will reject the incoming data.
Step 2: Set up the PagerDuty node to update the incident status
Add a PagerDuty node, configure the credentials with your PagerDuty API key, and set the operation to Update Incident. For the incidentId, use an expression to extract it from the webhook JSON payload like {{$json["body"]["context"]["pagerduty_incident"]}}.
Set the status field to resolved to mark the incident as closed.
Expected result: When triggered, PagerDuty incident status updates without manual intervention.
Step 3: Configure the Jira node to update the linked issue’s status
Add a Jira node, set credentials for Jira Cloud API, and choose Update Issue operation.
For issueKey, use the expression {{$node["Webhook"].json["body"]["context"]["jira_key"]}} to dynamically pick the issue from incoming webhook data.
Set statusId to 31 (corresponding usually to “Done”) in the update fields.
Note: This ID may vary depending on your Jira project workflow; confirm the correct status ID in your Jira instance.
Step 4: Add the first Mattermost node to notify the original channel
Add a Mattermost node, connect credentials, and set the message to notify the channel from which the webhook originated. Use the expression for channel ID: {{$node["Webhook"].json["body"]["channel_id"]}}.
Write the message content like 💪 This issue got closed in PagerDuty and Jira.
Result: The channel where the original message came will receive confirmation automatically.
Step 5: Set up the second Mattermost node to notify the on-call team
Add another Mattermost node, connect the same credentials, and set a fixed channel ID for your on-call team communication (e.g., k1h3du9r9byyfg7sys8ib6p3ey).
Set the message to something celebratory like 🎉 The incident ({{$node["PagerDuty"].json["summary"]}}) was resolved by the lovely folks in the on-call team!
Expected outcome: On-call team is immediately informed of incident closure, boosting morale and awareness.
5. Customizations ✏️
- Change Jira status ID: In the Jira node, modify the
statusIdto match your workflow statuses for more granular control. - Customize Mattermost messages: Edit the message fields in both Mattermost nodes to reflect your company’s tone or add dynamic data like timestamps or usernames.
- Add additional channels: Duplicate a Mattermost node and adjust the
channelIdto notify multiple teams or Slack channels if you integrate Slack instead. - Webhook security: Implement authentication or IP whitelisting in the Webhook node parameters to secure incoming requests.
6. Troubleshooting 🔧
- Problem: “Webhook POST not triggering workflow”
Cause: Incorrect webhook URL or HTTP method.
Solution: Verify webhook URL spelling and ensure HTTP method is POST in n8n Webhook node settings. - Problem: “PagerDuty API update failed”
Cause: Invalid API credentials or incident ID.
Solution: Double-check PagerDuty API key and confirm incident ID is correctly extracted from the webhook payload. - Problem: “Jira update error”
Cause: Wrong issue key or insufficient permissions.
Solution: Confirm Jira issue key matches and your API user has update permissions in the Jira project. - Problem: “Mattermost message not sent”
Cause: Wrong channel ID or credentials.
Solution: Validate Mattermost API token and confirm channel IDs.
7. Pre-Production Checklist ✅
- Test the webhook URL with sample POST data matching PagerDuty incident close structure.
- Verify PagerDuty credentials by manually triggering an incident update.
- Check Jira API connection and the ability to update issue status.
- Confirm Mattermost messages are delivered to intended channels.
- Backup your n8n workflow and export configurations before going live.
8. Deployment Guide
Once tested, activate the workflow by toggling the switch in n8n to make it live.
Monitor initial runs through the executions list to confirm smooth operation. If errors appear, use the troubleshooting tips above.
Optionally, set up alerts or logging for critical failures in your n8n instance.
9. FAQs
- Can I use Slack instead of Mattermost?
Yes, you can replace Mattermost nodes with Slack nodes configured with Slack API credentials. - Does this workflow consume many API credits?
The workflow uses minimal API calls per incident update, which should be well within most plans. - Is my data secure?
Yes, data is transmitted securely via HTTPS. For added security, consider adding authentications to the webhook. - Can it handle multiple incidents simultaneously?
Yes, n8n handles multiple concurrent webhook triggers efficiently.
10. Conclusion
By following this guide, you’ve automated your incident resolution process between PagerDuty, Jira, and Mattermost. This saves at least 30 minutes per incident, reduces errors, and keeps your team instantly informed.
Next steps? Consider adding automated incident creation or alert escalations for complete incident lifecycle automation. Or integrate other team collaboration tools you use for broader communication.
With this workflow, your incident management becomes smoother, faster, and more reliable — freeing you and your team to focus on what really matters.