From f2d2ee8875e9316396d1d17f13c1b485c471910f Mon Sep 17 00:00:00 2001 From: Jess MacQueen Date: Wed, 2 Nov 2016 17:34:01 -0700 Subject: [PATCH] fix handling of number fields in jira plugin (#73) * fix handling of number fields in jira plugin * handle floats and ints --- src/sentry_plugins/jira/plugin.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sentry_plugins/jira/plugin.py b/src/sentry_plugins/jira/plugin.py index 5ce873c0..86d40549 100644 --- a/src/sentry_plugins/jira/plugin.py +++ b/src/sentry_plugins/jira/plugin.py @@ -395,6 +395,14 @@ 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: + if '.' in v: + v = float(v) + else: + 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')):