I am trying to check diff for the pull request using bitbucket api v2.
I am able to create the pull request using rest api but while merging I am getting merge conflicts so to check which file has conflicts, I am trying to check diff for the generated pullrequest.
But I am getting a 403 forbidden error.
Can someone please help me.
It seems that it happens because redirect happens and authorization headers lost when in second request. This https://stackoverflow.com/a/28671822/6733637 should help (just check for HttpStatusCode.Forbidden).
Note however that this API did not help me with finding conflicts. I finally use trick described here https://community.atlassian.com/t5/Bitbucket-questions/REST-API-how-to-check-if-a-PR-has-conflict-s/qaq-p/716529#M28184
@jredmond because https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/diff API officially returns `302` and many HTTP clients including .NET HttpClient does not pass authorization headers to the second request.
Side question 1: What correct way to detect that PR is merge-able. The one I posted above with API V1?
Side question 2: Any chance PR ref (https://bitbucket.org/site/master/issues/5814/reify-pull-requests-by-making-them-a-ref) will be implemented?
Hello Community, I’m Anton Genkin, a product manager on the Bitbucket Server and Data Center team and am excited to share that Bitbucket Server 7.0 is now available! It's a platform release, one th...
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