Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-20266

Improve error message for API response when adding inactive user as a PR reviewer

    XMLWordPrintable

Details

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Issue Summary

      Using pullrequest update API endpoint, to add a reviewers to the existing Pull request, if you include UUID of a user that is set to inactive, our API responds with 

      "message": "reviewers: Malformed reviewers list"

      Steps to Reproduce

      1. Create a Pull request on Bitbucket
      2. Make sure the user who you would like to add has access to this repository
      3. Deactivate user's account via Active Directory (for managed account)
      4. Use the inactive user UUID to update the PR and try to add him as a reviewer

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

         5. Bitbucket will respond with not a very user friendly message that might lead to thinking that the syntax for JSON was wrong

      Expected Results

      To respond to the user indicating: "User you are trying to add as a reviewer is inactive, thus this action cannot be completed"

      Actual Results

      {"type": "error","error": {"fields": {"reviewers": [  "Malformed reviewers list"],},"message": "reviewers: Malformed reviewers list"}
      

      Workaround

      The workaround for the user is to go Bitbucket UI and check if the user he is trying to add as a reviewer is Active or not. This can also be checking by making a call to the user UUID endpoint and see if the user status is Active or Not.

      Then remove that user's UUID from the PUT request body to complete the PR update successfully.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ybazulina Yana
              Votes:
              4 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: