Every 5 minutes
Turn support emails into categorised Jira tickets
Every email to your support address becomes a Jira ticket with a category, priority and summary, and the sender gets an acknowledgement with the ticket number.
- Runs
- Every 5 minutes
- Apps
- Gmail, Jira
- AI
- Yes, uses the built-in AI allowance
- Access
- gmail.modify; Jira create issues
Send this to your assistant
Create a ClickRuntime automation: every 5 minutes, take new emails to support@, have AI pick a category, priority and summary, create a Jira ticket in SUP, reply to the sender with the ticket number, and label the email as logged.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A company's IT helpdesk lives in a shared inbox. Requests are answered in the order someone happens to open them, nobody knows how many are outstanding, and people email again to ask whether their first email arrived.
Turning every email into a categorised Jira ticket, and letting the sender know straight away, gives the helpdesk a real queue. Requesters have a reference number, and the team can see workload and priorities at a glance.
What you get out of it
A queue instead of an inbox
Every request becomes a ticket with a status. Nothing is lost or answered twice.
Senders know it arrived
An immediate reply with the ticket number cuts follow-up emails. People can quote the number when they chase.
Sorted on arrival
Category and priority are set from the email. Urgent requests rise to the top.
The inbox stays tidy
Logged emails get a label in Gmail. The team can see at a glance what has been handled.
How it works
What happens, step by step
Every 5 minutes, ClickRuntime looks in Gmail for new emails to your support address that have not been logged.
AI reads each email and picks a category, a priority and a one-line summary.
A Jira ticket is created with those details and the full email.
The sender gets a short reply with the ticket number.
The email is labelled as logged, so it is never handled twice.
Before it runs live
- Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
- Connect Jira
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 Slack
- Combine it with other Gmail and Jira steps into one automation
Under the hood
The code that runs this automation
import base64
from email.mime.text import MIMEText
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, ai, report_fetched
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)
gmail = lambda: build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users()
def send(to, subject, body, cc=None):
msg = MIMEText(body)
msg["To"], msg["Subject"] = to, subject
if cc: msg["Cc"] = cc
gmail().messages().send(userId="me", body={"raw": base64.urlsafe_b64encode(msg.as_bytes()).decode()}).execute()
LABEL_ID = "Label_123" # your "Logged" label
SCHEMA = {"type": "object", "properties": {"category": {"type": "string", "enum": ["access", "hardware", "software", "other"]},
"priority": {"type": "string", "enum": ["High", "Medium", "Low"]}, "summary": {"type": "string"}}}
@on_trigger
def run(event):
g = gmail()
msgs = g.messages().list(userId="me", q="to:support@acme.example -label:logged newer_than:2d").execute().get("messages", [])
report_fetched(len(msgs))
if not msgs:
return {"created": 0}
for m in msgs:
msg = g.messages().get(userId="me", id=m["id"], format="metadata", metadataHeaders=["From", "Subject"]).execute()
h = {x["name"]: x["value"] for x in msg["payload"]["headers"]}
t = ai.generate(f"Subject: {h.get('Subject')}\n{msg['snippet']}", json_schema=SCHEMA, max_output_tokens=100, system="Triage this IT support email.").json
issue = jira("POST", "/rest/api/3/issue", json={"fields": {"project": {"key": "SUP"}, "issuetype": {"name": "Task"}, "summary": t["summary"][:250],
"priority": {"name": t["priority"]}, "labels": [t["category"]], "description": adf(f"From {h['From']}\n\n{msg['snippet']}")}})
send(h["From"], f"[{issue['key']}] Re: {h.get('Subject', '')}", f"Thanks, we've logged your request as {issue['key']} and will be in touch soon.")
g.messages().modify(userId="me", id=m["id"], body={"addLabelIds": [LABEL_ID]}).execute()
return {"created": len(msgs)}FAQ
Common questions
Does it reply with the full answer?
What categories does it use?
Will replies to the acknowledgement create new tickets?
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
Turn vendor security advisories into Jira tickets
New security advisories from the vendors you rely on become Jira tickets, and you get an email for each one.
See how it worksEmail customers when the bug they reported is fixed
When a Jira bug is resolved, the customers who reported it get a short email from you saying it is fixed.
See how it worksTriage customer feedback into Jira and email critical issues
Each piece of customer feedback becomes a Jira issue with a type and severity, and critical problems are emailed to you straight away.
See how it worksKeep exploring
Set up “Turn support emails into categorised Jira tickets” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.