Skip to content

Commit 97838c3

Browse files
suyog19claude
andcommitted
fix: only notify on actual status changes in Jira webhook
Ignore webhook events that don't contain a status change in the changelog to prevent duplicate Telegram notifications. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 13e14fa commit 97838c3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

app/webhooks.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ async def jira_webhook(request: Request):
2424
status = fields.get("status", {}).get("name", "unknown")
2525
summary = fields.get("summary", "")
2626

27+
# Only process events that contain an actual status change
28+
changelog_items = payload.get("changelog", {}).get("items", [])
29+
status_changed = any(item.get("field") == "status" for item in changelog_items)
30+
if not status_changed:
31+
logger.info("Jira webhook ignored (no status change): %s", issue_key)
32+
return {"received": True, "processed": False}
33+
2734
logger.info("Jira webhook received: %s | %s | %s → %s", issue_key, issue_type, event_type, status)
2835

2936
with get_conn() as conn:

0 commit comments

Comments
 (0)