Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

pybitbucket requires reviewers for pullrequests to be specified by user name; server rejects it

michal March 13, 2019

I'm using the pybitbucket library to make a pull request.

I get back this response:

pybitbucket.bitbucket.BadRequestError: Attempted to request https://api.bitbucket.org/2.0/repositories/XXXXXXX/pullrequests.Bitbucket considered it a bad request. 400 - {"type": "error", "error": {"fields": {"reviewers": ["Malformed reviewers list"]}, "message": "reviewers: Malformed reviewers list"}}

 

I used this function to add reviewers (the user names are correct):

https://bitbucket.org/atlassian/python-bitbucket/src/c90076b960f8b83b2f9126adcabfef1db5cb89ba/pybitbucket/pullrequest.py#lines-102

The request JSON ends up with structures like:  'reviewers':[{'username':'some_user_name'}]

The server doesn't like that...

If I manually create the request and use the user uuids:

 

'reviewers':[{'username': '{21321321321312....}'}], that appears to work

 

However, I can't use that with pybitbucket, because it assumes and enforces that reviewers are specified by user name.

https://bitbucket.org/atlassian/python-bitbucket/src/c90076b960f8b83b2f9126adcabfef1db5cb89ba/pybitbucket/pullrequest.py#lines-39

 

So... who's wrong here?  (It's either the server or pybitbucket.)

 

 

1 answer

0 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 22, 2019

Hi Michal, welcome to the Community!

I've been trying to reach out to the maintainer of the library, but seems like he's no longer involved. 

In the meantime, I'd recommend you to post this question in our Developer Community, where you'll find a broader audience with these type of skills.

Hope that helps,

Ana

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events