You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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?
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.