Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,299,996
Community Members
 
Community Events
165
Community Groups

REST API request-changes

Hey,

after setting the user  with permissions to pullrequest:write the end point: 

/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changes

using post returns 400 something went wrong.

all other end points that i use seem to work fine.

the user is using a app password.

any suggestions why?

i noticed you have : "Check that no changes are requested" as well as "Reset requested changes when the source branch is modified" perhaps i need to turn these on?

3 answers

ok i understand what i did wrong. i was sending a wrong header.

i was using: {"Content-Type": "application/json"}

instead of: {'Accept': 'application/json'}

hence the bad request.

BUT

if the pull request was created by the same user as the user that is sending the api call it just returns a success without informing that nothing really happened because the pull request is owned by same user. i think api should either return failure or some sort of message that states that this is an invalid request because the PR is owned by same user or api should allow it that the owner of the PR can also request changes.

 

regards, Lior.

Syahrul Atlassian Team Nov 07, 2021

Hi @Lior Mizrahi

Glad to hear that you were able to locate the issue with the request.

Can you share with me the full cURL command and header user use so I can reproduce it? I did try on my end using application/json and was unable to reproduce it as it return a bad request error on my test.

I look forward to hearing from you.

Cheers,
Syahrul

as stated,

the user has both "write access" and "merge via pull request" access types on the branch.

it is using a a app password to communicate via rest api.

for some reason all other end points seem to work fine except this one.

i'm not sure why but i'm getting a "something went wrong response"

Syahrul Atlassian Team Nov 02, 2021

Hi @Lior Mizrahi 

Thanks for the update.

I am unable to reproduce the issue on my end with the same behavior. I am leaning towards user API calls, maybe a Bad request on the body or the endpoint since 400 error means we receive a bad request.

Would it be possible for you to share user API calls so I can review them? Please mask/remove any unnecessary information before sharing.

Cheers,
Syahrul

0 votes
Syahrul Atlassian Team Oct 31, 2021

Hi @Lior Mizrahi 

Welcome to the community.

Could you share with me how you configure the user permission to pull requests? I want to try reproducing this issue so it'd be great if you can share the steps you took from granting the user permission and running the API endpoint.

I look forward to hearing from you.

Cheers
Syahrul

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,248 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you