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

Pullrequests that contain commit

XtraSonic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 28, 2019

Hello,

I need to get all the pullrequests that contain a certain commit by using the API.

In the documentation i found that "/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/pullrequests" could be used to get a list of all pull requests that contain a commit which I think is what i would need (https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/commit/%7Bcommit%7D/pullrequests

When I try to use a get call (on bitbucket.org/!api/2.0/repositories/XtraSonic/<myrepo>/commit/<mycommit>/pullrequests) I get an error:

"message": "Resource not found",
"detail": "There is no API hosted at this URL.\n\nFor information about our API's, please refer to the documentation at: https://developer.atlassian.com/bitbucket/api/2/reference/"

If i delete the pullrequests at the end of the link, i do get the commit i am expecting.

Is the /pullrequests functionality no longer supported or am I missing something ?

 

1 answer

1 accepted

1 vote
Answer accepted
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 28, 2019

Hello @XtraSonic,

You should use api.bitbucket.org instead of /!api to fetch this data. Note that session authentication is not allowed on that domain, you should authenticate with basic auth (regular or app password) or OAuth token. This should work:

https://api.bitbucket.org/2.0/repositories/XtraSonic/<repo_slug>/commit/<commit_hash>/pullrequests

Let me know if you have any questions.

Cheers,
Daniil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events