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

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


1 badge earned


Participate in fun challenges

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


Gift kudos to your peers

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


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!


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
Community Members
Community Events
Community Groups

How to get latest pipelines from API

Deleted user Jul 04, 2022

I'm trying to get the latest pipelines running on a repo via API, but its only returning the pipelines that were first built.

I know that if I specify the UUID of a specific pipeline, it returns the required info that I'm trying to get, but I'm writing a script and manual UUID assignment is not possible.

Do you guys know what I could do so that I'd get the latest pipelines running?

1 answer

1 accepted

0 votes
Answer accepted
Patrik S Atlassian Team Jul 05, 2022

Hello @[deleted] ,

Welcome to Atlassian Community!

The Bitbucket public API offers sorting/querying capabilities so you can organize the results of the API accordingly to what best fits your use case.

In this case, if you want to order the results returned by the pipeline's endpoint accordingly to created_on date (more recent first), you can use the following example :

curl -X GET -u bitbucket_username:app_password "<workspace>/<repository>/pipelines/?sort=-created_on"

 This will sort the results based on the field created_on in descending order (because of the hyphen).

You also have the option to combine both querying and sorting, as in the below example :

curl -X GET -u bitbucket_username:app_password "<workspace>/<repository>/pipelines/?status=PENDING&status=BUILDING&status=IN_PROGRESS&sort=-created_on"

This will query for only the pipelines that are in the status considered "in progress", and sort the results based on created_on date.

The following pipeline statuses are available for querying/filtering : 

Successful: status=PASSED,SUCCESSFUL
Failed: status=FAILED,ERROR
Paused: status=PAUSED,HALTED
Stopped: status=STOPPED,SKIPPED

Hope that helps! Let me know in case you have any further questions.

Kind regards,

Patrik S 

Deleted user Jul 05, 2022

Thank you!

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events