Repositories API endpoint does not allow setting issue assignee as "null"

XMLWordPrintable

    • 1
    • Severity 3 - Minor
    • 6

      Issue Summary

      According to the documentation located here, it should be possible to unassign an issue by passing "null" value in the JSON argument, but it is not possible:
      https://developer.atlassian.com/cloud/bitbucket/rest/api-group-issue-tracker/#api-repositories-workspace-repo-slug-issues-issue-id-get

      Steps to Reproduce

      1. Run API command with PUT request method for a given issue in Bitbucket Cloud, passing through JSON argument to attempt to remove the assignee:
        {
           "assignee": null
        }
        
      2. Observe the 400 Bad Request HTTP response

      Expected Results

      • Successful HTTP response code, the issue has the original assignee removed and replaced with nothing

      Actual Results

      • No matter what is entered (ie null, -1, unassigned etc) you receive the following 400 response:
        {
        	"type": "error",
        	"error": {
        		"message": "Bad request",
        		"fields": {
        			"assignee": "None is not a collaborator on this repository"
        		}
        	}
        }
        
      • If you run a GET request on an issue which has not yet been assigned, it is clear that "null" value is used so it should be able to be set like this via the PUT method:
        {
        "assignee": null
        }
        

      Workaround

      • Unassign issues via the UI instead

            Assignee:
            Unassigned
            Reporter:
            Ben
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: