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:

      https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pullrequests/activity

      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.

       

          Form Name

            [JSWSERVER-20932] DVCS bitbucket cloud pull request endpoint fails to parse

            Leonardo Souto made changes -
            Affects Version/s New: 8.14.0 [ 92898 ]
            Sylwia Mikołajczuk made changes -
            Labels Original: dvcs dvcsconnector warranty New: 8.18.0-pd dvcs dvcsconnector warranty
            Sylwia Mikołajczuk made changes -
            Fix Version/s New: 8.18.1 [ 96092 ]
            Fix Version/s Original: 8.18.0 [ 95094 ]
            Rory Armstrong (Inactive) made changes -
            Fix Version/s New: 8.18.0 [ 95094 ]
            Ignat (Inactive) made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Waiting for Release [ 12075 ] New: Closed [ 6 ]
            Bugfix Automation Bot made changes -
            Support reference count Original: 4 New: 5
            set-jac-bot made changes -
            Fixed in Long Term Support Release/s New: [Download 8.5|https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html]
            Rory Armstrong (Inactive) made changes -
            Status Original: In Progress [ 3 ] New: Waiting for Release [ 12075 ]
            Rory Armstrong (Inactive) made changes -
            Fix Version/s New: 8.5.16 [ 95098 ]
            Fix Version/s New: 8.13.8 [ 95097 ]
            Bugfix Automation Bot made changes -
            Support reference count Original: 3 New: 4

              rarmstrong@atlassian.com Rory Armstrong (Inactive)
              rarmstrong@atlassian.com Rory Armstrong (Inactive)
              Affected customers:
              4 This affects my team
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: