Connect PagerDuty: step-by-step guide
Triggers one PagerDuty alert per failing test (dedup key nexus:<test>), adds to that same alert when the test fails again, and resolves it when the test passes clean. A failure after that triggers a new alert. This guide takes you from nothing to a verified connection, and lists the errors you can meet with their cause and fix.
Last updated:
Keep your credentials private. Never paste a token, key, password or webhook URL into a chat. Type it only in Studio → Settings → Integrations, where it is saved in your workspace's .env file and shown as dots. The same goes for an AI assistant: it can walk you through this guide, but it never needs your token.
What you need
- A PagerDuty service that should page on-call when tests fail.
- Permission to add an integration to that service.
Get the credentials
- In PagerDuty, open Services → Service Directory and pick the service (or create one with New Service).
- Open its Integrations tab, choose Add another integration, select Events API V2 and press Add.
- Open the new integration and copy its Integration Key, the 32-character routing key.
Connect it in the Studio
- In the Studio, open Settings → Integrations → PagerDuty.
- Paste the key in
PAGERDUTY_ROUTING_KEY, turn onPAGERDUTY_ENABLEDand press Save changes. - Open the Tickets page. Under Where, pick + Add a destination → PagerDuty, then press save tickets.
Check that it works
- There is no test alert for PagerDuty: run a test that fails. The run log shows "[PagerDuty] triggered nexus:<test>" and the alert appears on the service.
- Run the test again so it passes: the log shows "resolved" and the alert is resolved in PagerDuty.
Common errors
| What you see | Cause | Fix |
|---|---|---|
"[PagerDuty] needs PAGERDUTY_ROUTING_KEY (an Events API v2 integration key): nothing sent" | The key is empty or has characters a routing key never has (spaces, dashes). | Copy the Integration Key again from the service's Events API V2 integration. |
| "PagerDuty answered HTTP 400" | PagerDuty refused the event: most often a key that is not an Events API v2 integration key (an API access key or a user token). | Use the Integration Key of an Events API V2 integration on the service. |
| "PagerDuty answered HTTP 429" | Too many events in a short time. | Wait; the Studio retries. For a large failing suite, set a Maximum tickets per run on the Tickets page. |
| The alert triggers but never resolves | The test has not passed clean on every browser of a run, or "When the test passes again" is set to Do nothing on the Tickets page. | Set it to Comment and close, and check the run where the test passed. |
Settings keys
| Key | What it does | Valid value | How to check it |
|---|---|---|---|
PAGERDUTY_ENABLED | Page on-call in PagerDuty | true or false | Turn on, add the PagerDuty destination on the Tickets page, then run a failing test. |
PAGERDUTY_ROUTING_KEY | PagerDuty integration key (secret, saved only on this computer) | The Events API v2 Integration Key: letters and digits only, 20 to 64 characters (PagerDuty's is 32) | HTTP 400 in the run log usually means the key is not an Events API v2 key. |
More: all integrations, the Settings guide, troubleshooting. Other guides: Jira Cloud, Azure Boards, Slack, Microsoft Teams, Telegram, GitHub Issues, Linear, GitLab Issues, TestRail, Ticket webhook, Tickets.
Still stuck? Write to support@nexusstudioqa.com with the exact error line the Studio shows. Do not include a token.