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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,558,481
Community Members
 
Community Events
184
Community Groups

bitbucket rest api get PRs of particular branch

Edited
Abbas Mohammed
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!
Apr 27, 2023

Trying to fetch all the PRs merged to develop branch using bitbucket api.  But it is fetching all the PR of other branches also.

Want to fetch PRs of particular branch say "develop" or "release"

 

https://api.bitbucket.org/2.0/repositories/<workspace-id>/<repo>/pullrequests/?at=develop

 

Tried with 

https://api.bitbucket.org/2.0/repositories/workspace-id/repo/pullrequests/?

destination.branch.name=develop
Both ways it is fetching PRs of other branches too.

1 answer

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Apr 28, 2023

Hi @Abbas Mohammed and welcome to the community!

You can try with a query as follows:

https://api.bitbucket.org/2.0/repositories/workspace-id/repo/pullrequests?q=(destination.branch.name="develop")

Certain characters in the query may need URL encoding, and with URL encoding it will look as follows:

https://api.bitbucket.org/2.0/repositories/workspace-id/repo/pullrequests?q=%28destination.branch.name%3D%22develop%22%29

Does this work for you?

Just a heads up, I removed the workspace id and repo name from your post to protect your privacy.

Kind regards,
Theodora

Abbas Mohammed
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!
May 01, 2023

Thanks @Theodora Boudale  it is working as expected.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 02, 2023

You are very welcome, please feel free to reach out if you ever need anything else!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events