Browse Source

fix(hybridcloud) Add missing int() on jira issue_id (#68098)

Can't do modulus math on strings.

Fixes SENTRY-34JX
Mark Story 11 months ago
parent
commit
8d3daa03a3

+ 1 - 1
fixtures/integrations/jira/stubs/edit_issue_assignee_payload.json

@@ -14,7 +14,7 @@
     "id": "10172"
   },
   "issue": {
-    "id": 101,
+    "id": "101",
     "fields": {
       "assignee": {
         "emailAddress": "jess@sentry.io",

+ 5 - 0
src/sentry/middleware/integrations/parsers/jira_server.py

@@ -63,6 +63,11 @@ class JiraServerRequestParser(BaseRequestParser):
         if not issue_id or not enabled:
             return str(integration.id)
 
+        try:
+            issue_id = int(issue_id)
+        except ValueError:
+            return str(integration.id)
+
         # If we get fewer than 3000 in 1 hour we don't need to split into buckets
         ratelimit_key = f"webhookpayload:{self.provider}:{integration.id}"
         if not ratelimiter.is_limited(key=ratelimit_key, window=60 * 60, limit=3000):