-
Bug
-
Resolution: Fixed
-
Low
-
8.5.0, 8.13.0, 8.14.0
-
8.05
-
5
-
Severity 3 - Minor
-
40
-
Issue Summary
Caused by: java.lang.UnsupportedOperationException: JsonObjectCaused by: java.lang.UnsupportedOperationException: JsonObject at com.google.gson.JsonElement.getAsString(JsonElement.java:191) at com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.model.repository.pullrequest.BitbucketPullRequestActivityEnvelopeDeserializer.deserialize(BitbucketPullRequestActivityEnvelopeDeserializer.java:46)
java.lang.UnsupportedOperationException: JsonObject is thrown by BitbucketPullRequestActivityEnvelopeDeserializer when it fails to deserialize the pull request endpoint payload:
It parses the "pull_request" object and then attempts to find either one of the following json objects: "comment", "approval", or "update".
If it fails to find either of these json objects then it throws the above exception.
Replication steps
- Create a Pull Request with an approver
- Approver sets status to 'Changes Requested'
- DVCS syncs Pull Request
Expected Result
DVCS ignores pull request activity type for `changes_requested`
Actual result
DVCS fails with pull request activity type for `changes_requested`
Workaround
None yet
Suggested Fix
Handle missing data correctly rather than throwing an exception.
Also suggest we add more logging to diagnose the potential source of the issue as currently we can't tell what the contents of the payload from Bitbucket is.