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

API Filter Doesn't Work

The API to access pipeline resources does not accept query parameters. 

For example, the following command returns all pipelines, not filtering at all. Note that the slash at the end of the URL (after "pipelines") is required for some reason; the API doesn't work without it. Note also that the ?sort= query parameter works.

curl -u {user}:{password} -X GET -H "Content-Type: application/json" https://api.bitbucket.org/2.0/repositories/{workspace}/{repo}/pipelines/?q=build_number%3D10

In contrast, the following call to the repositories/ path works, returning a single repo: 

curl -u {user}:{password} -X GET -H "Content-Type: application/json" https://api.bitbucket.org/2.0/repositories/{workspace}?q=name%3D%22example-repo%22

Can you please investigate this issue?

1 answer

1 accepted

0 votes
Answer accepted
Norbert C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Nov 24, 2021

Hi Adam,

Thank you for contacting Atlassian Community Support. I'm Norbert from Bitbucket Cloud Support, it's nice to meet you!

I'd like to inform you that indeed the following query doesn't work

curl -u {user}:{password} -X GET -H "Content-Type: application/json" https://api.bitbucket.org/2.0/repositories/{workspace}/{repo}/pipelines/?q=build_number%3D10

But as a workaround, when I've tried the following query, it showed me the details from my build:


curl -u user:password -X GET -H "Content-Type: application/json" https://api.bitbucket.org/2.0/repositories/workspace/repository/pipelines/buildnumber

Can I ask you to try to query the build using "pipelines/buildnumber" way and let me know if this workaround work for you?

I'm looking forward to hear from you.

Have a great week ahead!

Best Regards,
Norbert
Atlassian Bitbucket Cloud Support Engineer

@Norbert C Thanks a lot for the reply. I'm trying this approach, but still can't figure out the right syntax. I've tried the following, which fail: 

  • pipelines/buildnumber/10 (404)
  • pipelines/buildnumber/10/ (extra slash at the end) (404)
  • pipelines/buildnumber?q=10 (400)
  • pipelines/buildnumber/?q=10 (404)
  • pipelines/buildnumber (400)
  • pipelines/buildnumber/ (404)
  • pipelines/buildnumber%3D10 (400)
  • pipelines/buildnumber%3D10/ (404)
  • pipelines?q=buildnumber%3D10 (404)
  • pipelines/?q=buildnumber%3D10 (returns all builds)
  • pipelines?buildnumber=10 (404)
  • pipelines/?buildnumber=10 (returns all builds)
Norbert C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 01, 2021

Hi Adam,

Thank you for your reply.

Can I ask you to create a screenshot with the API call what you do, masking the private/confidential information, please? When I did the following API call, I've got an output from build #2. Once I have a screenshot, I might be able to see what went wrong with the API call.

apicall.png

I'm looking forward to hear from you, Adam.

Have a great day!

Best Regards,
Norbert 
Atlassian Bitbucket Cloud Support

Ok, by using just the integer build number, this works as intended now. 

Thanks a lot for your help. 

Norbert C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 02, 2021

You're welcome Adam, we're always happy to help ;) 

Have a great weekend ahead!

Best Regards,

Norbert
Atlassian Bitbucket Cloud Support

Suggest an answer

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

Atlassian Community Events