Skip to content

Commit b80cf39

Browse files
committed
allow empty assignee field.
1 parent 1cc4c03 commit b80cf39

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Issue/Reporter.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ class Reporter implements \JsonSerializable
2424

2525
public function jsonSerialize()
2626
{
27-
return array_filter(get_object_vars($this));
27+
return array_filter(get_object_vars($this), function ($value, $key) {
28+
// allow empty assignee. See https://github.com/lesstif/php-jira-rest-client/issues/18
29+
if ($key === 'name' && !is_null($value)) {
30+
return true;
31+
}
32+
return !empty($value);
33+
}, ARRAY_FILTER_USE_BOTH);
2834
}
2935
}

0 commit comments

Comments
 (0)