Introduction
Jira is a central tool for task tracking in support teams. But standard Jira notifications often get lost in the email flood. We solved this by creating a containerized Python daemon that monitors the Jira API and sends smart alerts to Telegram.
Connecting to Jira API
from jira import JIRA
def get_jira_client():
return JIRA(
server=“https://jira.example.com”,
basic_auth=(JIRA_USER, JIRA_TOKEN)
)
def get_urgent_issues(jira):
jql = ('project = SUPPORT AND priority in (P1, P2) '
‘AND status = Open AND assignee is EMPTY’)
return jira.search_issues(jql, maxResults=50)
Issue Monitoring
The daemon periodically polls the Jira API, checking for new issues, status changes, and overdue SLAs. For each event type, it formats a corresponding notification with context — priority, queue time, assigned engineer.
Sending Alerts to Telegram
Different severity levels use different channels: P1 issues go to the general channel with responsible mentions, P2 to the work chat, P3/P4 as personal notifications to the assigned engineer.
Daemon Architecture
The daemon runs inside a Podman pod alongside Valkey for state storage (which issues have been processed, when the last alert was sent). The SSH tunnel to Jira launches as a sidecar container using the ephemeral container pattern.
Logging Strategy
Structured JSON logs contain: timestamp, level, issue_key, alert_type, and send result. Logs output to the container’s stdout and are collected via podman logs or journald. Log rotation is configured through systemd.
Deployment with Podman Pods
The entire stack deploys as a single Podman pod: Valkey for state, the alert daemon, and an optional SSH tunnel sidecar. Environment variables configure Jira credentials and Telegram bot tokens.
Deduplication Protection
Valkey stores a hash of recently processed events. Before sending an alert, the daemon checks if it was already sent. TTL on keys automatically cleans old entries, preventing memory growth.
Conclusion
Automating Jira through Python and a containerized daemon creates a reliable alerting system independent of Jira’s built-in mechanisms. Podman pods provide isolation and deployment simplicity.