(I tried to post this earlier today, but I don't see it anywhere, so I guess it didn't work somehow.)
I'm using BitBucket Server v4.9.0.
I want to get the list of pull requests that a commit is part of.
I went to the top-level REST api docs, at https://docs.atlassian.com/bitbucket-server/rest/5.12.0/bitbucket-rest.html#idm45885143329280 . Now that I'm looking at this URL, I wonder if 5.12.0 represents the API version, which is newer than 4.9.0, which is perhaps why what I'm trying to do isn't working.
In any case, this page clearly says that I can get the pull requests from the commit, but when I use this URL, I get a 404. I tried removing "pull-requests", and that doesn't fail, it just gives me information about the commit itself.
Until our enterprise upgrades to a newer release, is there some other way I can use the API to get the list of pull requests a commit is on?
Regarding this REST endpoint:
/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/pull-requests
You are correct: that REST endpoint is not available in Bitbucket Server version 4.9.0.
It's not even available in version 5.10.0 of Bitbucket Server. The earliest version where I could locate that REST endpoint is Bitbucket Server 5.11.1:
https://docs.atlassian.com/bitbucket-server/rest/5.11.1/bitbucket-rest.html#idm46358292211472
One question: are you trying to locate pull-requests associated with a commit BEFORE the pull-request is merged, or after? (Or both?)
I can see it being useful to get this info both before and after merging.
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.