How to automatically create Jira issues from Sentry errors
You connect Sentry to Jira, set up an alert, go looking for the action that files a Jira issue, and it isn't there, or it's there and greyed out. The Jira integration works on your plan. Automatic issue creation doesn't.
Here's what each Sentry plan can actually do with Jira, and the ways to get errors filed automatically without changing plans.
1. What Sentry's own Jira integration does on each plan
- Developer (free): no Jira integration. Third-party integrations start on Team.
- Team: manual issue management. From a Sentry issue, open Linked Issues and create or link a Jira issue by hand. Issue sync also works here, so comments, assignees and status can follow between the two.
- Business and Enterprise: everything above, plus automatic issue management. Create an alert, choose Create a new Jira issue as its action, and Sentry files the issue when the alert fires.
So if you're on Team, every Jira issue for an error is one somebody remembered to create. If you want it to happen without anyone clicking, Sentry's answer is a plan upgrade. Check Sentry's pricing page for the current difference.
2. Build it yourself with a webhook
Every Sentry plan can send an alert to a webhook. Sentry calls it an internal integration: you give it a URL, connect it to an alert, and Sentry posts a JSON payload each time the alert fires. Point that at something that can create a Jira issue and you have auto-create on any plan.
It works, and it's a weekend if you've done this kind of thing before. The parts that take longer than you'd expect:
- Checking the signature. Sentry signs every request. If you don't verify it, anyone who finds the URL can file Jira issues in your projects.
- Not filing the same error twice. You need to remember which Sentry issue maps to which Jira issue, or a recurring error opens a new ticket every time.
- Bad deploys. A broken release throws hundreds of different errors in minutes. De-duplication doesn't help with those, so without a cap your backlog fills up.
- What's in the payload. Sentry events can carry local variables, cookies and request headers, which in a real app means secrets and customer data. Copy the payload into a ticket and that's where they end up.
- Answering quickly. Sentry gives the webhook a short timeout, so creating the Jira issue has to happen after you've replied, not before.
- Somewhere to run it, and someone to notice when it stops.
3. Use an app that does the webhook part for you
We make one called Triage for Jira. It's the webhook approach above, built and running inside your own Atlassian site, so there's no server for you to host.
- It works on whatever Sentry plan you have, including the free one, because Sentry calls it and it never calls Sentry.
- It checks Sentry's signature before it reads anything, and strips local variables, cookies and headers before anything is stored.
- A repeat of the same error bumps a count on the existing work item instead of opening a new one, and an hourly cap, on by default, stops a bad deploy flooding your backlog.
- You write the rules: which Sentry project, which error levels, which Jira project and work type.
- The error count lands in a real Jira field, so
"Sentry Error Count" > 100works in JQL, filters and dashboards. - Its screens are served entirely from Atlassian, so it works with ad blockers turned on.
Setting it up takes about ten minutes:
- Install Triage for Jira from the Atlassian Marketplace and create a connection. It gives you a webhook URL.
- In Sentry, create an internal integration with that URL, and paste its Client Secret back into the app.
- Connect an alert on your project's error monitor to the integration.
- Turn the app on for your Jira project and write a rule.
The setup guide covers each step, including the two people usually miss. It's free for Jira sites of ten users or fewer. Above that it's priced per Jira seat through the Marketplace.
Good to know
- Any webhook approach, ours included, is one-way. Resolving the Jira issue won't resolve the error in Sentry.
- The webhook doesn't carry Sentry's lifetime event count for an issue, so a count built from webhooks starts at zero when you set it up.
- Self-hosted Sentry can post to a webhook the same way sentry.io does, so all of this works for self-hosted instances too.
- On Triage's free tier, rules filter by error level. Filtering by environment, occurrence count or title, and syncing status from Sentry, are part of Pro.