BZ-1065314 - (Jaxb)Task could not be converted to JSON (integral commit)

Squashed:
- cherry pick from commit 4c3d9b582e6f74e16894846791bbe5ebc34a470f
- cherry pick from commit a3a6d829b7533a5c6d45ce698d4b747076df69b1