From 6cc0f886f291a6de09a745a8187042acb80a25fd Mon Sep 17 00:00:00 2001 From: Jess MacQueen Date: Wed, 2 Nov 2016 16:24:12 -0700 Subject: [PATCH 1/2] fix handling of number fields in jira plugin --- src/sentry_plugins/jira/plugin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sentry_plugins/jira/plugin.py b/src/sentry_plugins/jira/plugin.py index 5ce873c0..aaa55069 100644 --- a/src/sentry_plugins/jira/plugin.py +++ b/src/sentry_plugins/jira/plugin.py @@ -395,6 +395,11 @@ def create_issue(self, request, group, form_data, **kwargs): v = [v] elif schema.get('custom') == JIRA_CUSTOM_FIELD_TYPES.get('textarea'): v = v + elif schema['type'] == 'number': + try: + v = int(v) + except ValueError: + pass elif (schema.get('type') != 'string' or schema.get('items') != 'string' or schema.get('custom') == JIRA_CUSTOM_FIELD_TYPES.get('select')): From 0ffe37e2b2b419be898e6c337d2ebb5254d8699e Mon Sep 17 00:00:00 2001 From: Jess MacQueen Date: Wed, 2 Nov 2016 17:12:05 -0700 Subject: [PATCH 2/2] handle floats and ints --- src/sentry_plugins/jira/plugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sentry_plugins/jira/plugin.py b/src/sentry_plugins/jira/plugin.py index aaa55069..86d40549 100644 --- a/src/sentry_plugins/jira/plugin.py +++ b/src/sentry_plugins/jira/plugin.py @@ -397,7 +397,10 @@ def create_issue(self, request, group, form_data, **kwargs): v = v elif schema['type'] == 'number': try: - v = int(v) + if '.' in v: + v = float(v) + else: + v = int(v) except ValueError: pass elif (schema.get('type') != 'string'