1
0
Fork 0

Non mandatory number fields can be set to null

Fixes Issue https://github.com/rcarz/jira-client/issues/188
master
Vivek Ganesan 2016-11-21 21:35:44 +05:30 committed by GitHub
parent c9220cb17e
commit 7ea6f3b7d5
1 changed files with 3 additions and 1 deletions

View File

@ -726,7 +726,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");