The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

kuwilk
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!
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

Comments for this post are closed

Community moderators have prevented the ability to post new 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

TAGS
AUG Leaders

Atlassian Community Events