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

Fetch details of Bitbucket (cloud) pipelines with filters using the Bitbucket cloud REST API

kuwilk October 18, 2020

tried using this,

curl -G -H "Authorization: Bearer {mmpvgTwfY54A5Nv3Ggmsm35GULHwEsBlx3P1h_t5yrPwYbPZfm7T8xGtqUtc6thNcGvkzm1EBm6BFcKDtVY=}" -H "Accept: application/json" "https://api.bitbucket.org/2.0/repositories/ifs-pd/ifs-applications/pipelines/" --data-urlencode 'sort=-created_on'

and it worked!

BUT this API end point doesn't seem to respond to any query params. Tried using --data-urlencode "q=created_on > 2020-10-17" for example, but it simply doesn't work. Returns the same JSON document that lists all of the pipelines.

Tried a few other end points like e.g.

curl -G -H "Authorization: Bearer {QwpvgYrfw69Z5Nv3Qgmsm3m8ULHwEsBlx3P1h_t5yrPwYbPZfmV78xGtqUtc6thNcGvkzm1EBm6BFcKTHVY=}" -H "Accept: application/json" "https://api.bitbucket.org/2.0/repositories/ifs-pd/ifs-applications/pullrequests/" --data-urlencode 'sort=-created_on&page=2' and they worked as documented.

Has anybody tried using the REST API for Bitbucket cloud pipelines? Would appreciate any explanation/insight. 

Thanks!

2 answers

0 votes
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 13, 2020

@kuwilk hello, we actually have a pipe that may cover your needs (look at https://bitbucket.org/atlassian/bitbucket-build-statistics/src/master/) This pipe gather statistics of run pipelines builds for given (or current) repository for n days.

Or if it does not cover what you'd like to implement, tell in more detail, what do you want to get from the build, what info?

Also look at bitbucket api doc

https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pipelines/

and

https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pipelines/%7Bpipeline_uuid%7D

Cheers, Galyna

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events