The moment it happens
Alert Slack on production errors with one Jira bug per error
Production errors are posted to Slack straight away, and each distinct error opens exactly one Jira bug, with repeats added as comments.
- Runs
- The moment it happens
- Apps
- Jira, Slack
- AI
- Optional
- Access
- Jira create; Slack chat:write
Send this to your assistant
Create a ClickRuntime automation: when an error arrives at the trigger link, post it to #alerts, and open a Jira bug in ENG unless there's already an open ticket for the same error; if there is, add a comment instead.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A web app's monitoring sends every error to Slack, and someone creates Jira bugs by hand when they have time. The same error ends up with three tickets, while a new one goes unticketed because everyone assumed someone else had filed it.
Posting each error immediately and filing exactly one ticket per distinct error, with repeats noted as comments, keeps the backlog accurate. The team sees how often each error happens and fixes the noisiest first.
What you get out of it
Instant awareness
Errors reach Slack in seconds. The team knows about problems before customers report them.
One ticket per problem
Repeats of the same error are added to the open ticket. The backlog stays clean.
Frequency is visible
Comments on the ticket show each time the error happened again. The noisiest errors are easy to spot.
Severity in the alert
Each Slack post shows the error's severity. Critical problems stand out from warnings.
How it works
What happens, step by step
When your monitoring reports an error, it sends the details to your automation's trigger link.
The error is posted to your #alerts Slack channel with its severity.
ClickRuntime makes a fingerprint of the error and looks for an open Jira ticket with the same fingerprint.
If there is one, it adds a comment with the new occurrence; if not, it opens a new bug.
If you turn on AI, new tickets include a short note on the likely cause.
Before it runs live
- Connect Jira
- Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
- Paste your automation's link into the other app's webhook settings
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Google Sheets
- Combine it with other Jira and Slack steps into one automation
Under the hood
The code that runs this automation
import hashlib
from clickruntime import on_event, credentials, http, notify, ai
JIRA, SITE = "https://api.atlassian.com/ex/jira/your-cloud-id", "https://acme.atlassian.net/browse/"
adf = lambda text: {"type": "doc", "version": 1, "content": [{"type": "paragraph", "content": [{"type": "text", "text": text}]}]}
def jira(method, path, **kw):
resp = http.request(method, JIRA + path, headers={"Authorization": f"Bearer {credentials.connection('jira', 'work')}", "Accept": "application/json"}, **kw)
return resp.raise_for_status() or (resp.json() if resp.content else None)
@on_event
def handle(event):
err = event.json or {}
text = f"{err.get('name')} in {err.get('service')}: {err.get('message', '')}"
notify.slack(f"[{err.get('severity', 'error')}] {text}", channel="#alerts")
fp = "err-" + hashlib.sha1(f"{err.get('service')}|{err.get('name')}".encode()).hexdigest()[:10]
found = jira("POST", "/rest/api/3/search/jql", json={"jql": f'project = ENG AND labels = "{fp}" AND statusCategory != Done', "fields": ["key"], "maxResults": 1})["issues"]
if found:
jira("POST", f"/rest/api/3/issue/{found[0]['key']}/comment", json={"body": adf(f"Happened again at {event.received_at}: {text}")})
return {"issue": found[0]["key"], "new": False}
note = ""
try:
note = ai.generate(f"{text}\n{(err.get('stack') or '')[:3000]}", system="Give the likely cause in 2 sentences.", max_output_tokens=120).text
except (ai.AINotIncluded, ai.AILimitReached):
pass
issue = jira("POST", "/rest/api/3/issue", json={"fields": {"project": {"key": "ENG"}, "issuetype": {"name": "Bug"}, "labels": [fp],
"summary": f"[Error] {err.get('name')} in {err.get('service')}"[:250], "description": adf(f"{text}\n\n{note}")}})
notify.slack(f"New bug {issue['key']} opened for this error: {SITE}{issue['key']}", channel="#alerts")
return {"issue": issue["key"], "new": True}FAQ
Common questions
How are errors matched to existing tickets?
What happens after the ticket is closed?
Can AI explain the error?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Update Jira and post release notes to Slack when you tag a release
When a release is tagged, the Jira tickets mentioned in its commits get a fix version and move to Done, and Slack gets the release notes.
See how it worksTriage support requests into Jira and alert the right Slack channel
Each incoming support request becomes a Jira ticket with a category, priority and summary, and is posted to the Slack channel for that category.
See how it worksTurn security alerts into Jira tickets and Slack messages
Each security alert creates one Jira ticket, posts to your security channel, and messages the affected person in Slack when the alert names them.
See how it worksKeep exploring
Set up “Alert Slack on production errors with one Jira bug per error” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.