1. What This Automation Does
This n8n workflow connects PagerDuty incidents with Jira and Mattermost. It solves the problem of manual work to track and update incidents across tools. The result is automatic Jira issue creation, Mattermost channel setup, and live status updates via buttons.
When PagerDuty sends an incident alert, the workflow creates a Jira ticket for it. It also makes a new Mattermost channel named after the incident. Teams get instant notifications with links to PagerDuty and Jira.
Users in Mattermost can then acknowledge or resolve the incident by clicking buttons. These buttons update PagerDuty and Jira statuses instantly. The workflow also posts status updates in the Mattermost channel so everyone stays in sync.
This reduces manual copying and errors. It speeds up the incident lifecycle from alert to resolution. Teams save time and avoid confusion during incidents.
2. Tools and Services Used
- PagerDuty API: Sends incident webhook events, status updates.
- Jira Software Cloud API: Creates and manages Jira issues.
- Mattermost API: Creates channels, sends messages, interactive buttons.
- n8n Workflow Automation: Orchestrates the process and API calls.
3. Inputs, Processing, and Outputs
Inputs
- PagerDuty incident webhook event with incident details.
- User actions in Mattermost clicking acknowledge or resolve buttons.
Processing Steps
- Receive PagerDuty webhook via Webhook node.
- Create a Mattermost incident channel with Mattermost1 node.
- Add on-call user to the channel using Mattermost2 node.
- Create Jira issue linked to incident with Jira1 node.
- Send notification messages to Mattermost with Mattermost3 and Mattermost4 nodes, including buttons.
- Listen to acknowledgments or resolve button clicks with webhook nodes Ack and Resolve.
- Update PagerDuty incident status via PagerDuty1 and PagerDuty2 nodes.
- Update Jira issue status via Jira2 node.
- Post status updates back to Mattermost with Mattermost5, Mattermost6, and Mattermost7 nodes.
Outputs
- New Jira issue created per PagerDuty incident.
- Mattermost channel created and users added.
- Issue and incident status updated in PagerDuty and Jira automatically via Mattermost button interactions.
- Real-time status messages posted to Mattermost channels.
4. Beginner Step-by-Step: How to Use This Workflow in n8n
Step 1: Download and Import
- Download the workflow file using the Download button on this page.
- Open the n8n editor where you want to run the automation.
- Use the Import from File option to add the downloaded workflow.
Step 2: Configure Credentials
- Add your PagerDuty API Key in n8n credentials.
- Add your Jira Software Cloud API credentials.
- Add your Mattermost API credentials.
Step 3: Update Configuration Items
- Check the Webhook node path and ensure it matches PagerDuty webhook setup.
- Update team ID and user IDs in Mattermost1 and Mattermost2 nodes to match your Mattermost environment.
- Change Jira project ID and hardcoded assignee user to your project and user in Jira1 node.
- Ensure all URLs in button payloads point to correct n8n webhook endpoints.
Step 4: Test the Workflow
- Create a test incident in PagerDuty to trigger the workflow.
- Watch for new Jira issues, Mattermost channels, and messages.
Step 5: Activate for Production
- Activate the workflow toggle to turn live.
- Monitor webhook logs for successful executions.
Using self-host n8n can improve control and security when running this workflow.
5. Step-by-Step Mini Breakdown of Workflow Nodes
Receiving the Incident
- Webhook node receives POST request from PagerDuty for new incidents.
Creating Mattermost Channel
- Mattermost1 node creates a channel named after the PagerDuty incident key.
- Mattermost2 node adds the on-call user to the new channel.
Creating Jira Issue
- Jira1 node creates a new issue with title from incident.
- The summary uses this expression for the title:
= {{$node["Webhook"].json["body"]["event"]["data"]["title"]}}
Notifying Mattermost
- Mattermost3 sends a notification message with links to PagerDuty and Jira.
- Mattermost4 sends a message with buttons “Acknowledge” and “Resolve” that connect to webhook URLs.
Handling Button Clicks
- Ack webhook node receives acknowledge button clicks, updates PagerDuty incident status via PagerDuty1 node, and posts update to Mattermost5.
- Resolve webhook node receives resolve button clicks, updates PagerDuty via PagerDuty2 node, Jira issue via Jira2 node, and posts closure updates via Mattermost6 and Mattermost7 nodes.
6. Common Troubleshooting
- Webhook does not receive events: Check PagerDuty webhook URL matches the Webhook node URL exactly and HTTP method is POST.
- Jira issue creation fails: Verify Jira API Key permissions and that the project ID is correct in Jira1 node.
- Mattermost buttons do not work: Confirm interactive button webhook URLs are correct and match Ack and Resolve webhook node URLs in n8n.
7. Customizations
- Change the Jira project ID in Jira1 node to your project.
- Modify Mattermost messages in Mattermost3 and Mattermost4 nodes for custom text or extra fields.
- Add more buttons in Mattermost4 node for other incident actions using webhook URLs.
- Make the Jira assignee dynamic by extracting it from the PagerDuty payload instead of hardcoding.
- Notify multiple Mattermost channels by adding extra Mattermost nodes triggered on incident tags or priorities.
8. Pre-Production Checklist
- Trigger test incidents in PagerDuty to verify webhook receipt.
- Ensure Mattermost channels are created and correct users added.
- Confirm Jira issues get created with correct projects and assignees.
- Test interactive buttons to see if ack and resolve flows run properly.
- Have a rollback plan to disable PagerDuty webhook if things go wrong.
9. Deployment Guide
Turn on the workflow toggle in n8n to make the automation live.
Monitor the webhook logs for calls from PagerDuty and button interactions.
Keep logs of all incident updates for review.
Set alerts in n8n for failures if desired.
Using self-host n8n is recommended for stability and control in production.
10. Summary
✓ Saves time by creating Jira tickets automatically from PagerDuty alerts.
✓ Sends instant Mattermost notifications and creates incident channels.
✓ Lets teams update incident status using Mattermost buttons that sync with PagerDuty and Jira.
✓ Reduces manual errors and speeds up incident resolution.
→ Links your incident tools into one smooth automated process.
→ Gives clear, real-time updates to everyone on the team.
