1
0
Fork 0

Merge pull request #189 from vivganes/patch-1

Allow null to be set as value for numeric fields
master
Bob Carroll 2017-07-02 12:22:20 -07:00 committed by GitHub
commit b0d7ee7a42
2 changed files with 4 additions and 1 deletions

View File

@ -7,3 +7,4 @@
* Anders Kreinøe <anders@kreinoee.dk> @Kreinoee
* Andrey Kuzmin <agkoozmin@gmail.com> @nach-o-man
* Pierre-Luc Dupont <pldupont@gmail.com> @pldupont
* Vivek Ganesan <vivek@vivekganesan.com> @vivganes

View File

@ -729,7 +729,9 @@ public final class Field {
else if (value instanceof TimeTracking)
return ((TimeTracking) value).toJsonObject();
} else if (m.type.equals("number")) {
if(!(value instanceof java.lang.Integer) && !(value instanceof java.lang.Double) && !(value
if (value == null) //Non mandatory number fields can be set to null
return JSONNull.getInstance();
else if(!(value instanceof java.lang.Integer) && !(value instanceof java.lang.Double) && !(value
instanceof java.lang.Float) && !(value instanceof java.lang.Long) )
{
throw new JiraException("Field '" + name + "' expects a Numeric value");