Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
fix handling of number fields in jira plugin (#73)
Browse files Browse the repository at this point in the history
* fix handling of number fields in jira plugin

* handle floats and ints
  • Loading branch information
macqueen authored Nov 3, 2016
1 parent 1ba6381 commit f2d2ee8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/sentry_plugins/jira/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')):
Expand Down

0 comments on commit f2d2ee8

Please sign in to comment.