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

REST API Is there some way to get commits until a certain commit uuid or date ?

Hassan Adel March 18, 2019

Hello, I'm getting the commits for a certain repo slug using the API 
https://api.bitbucket.org/2.0/repositories/{username}/{repo-slug}/commits

Is there some way to get commits until a certain commit uuid or date ?
Thanks.

4 answers

1 accepted

1 vote
Answer accepted
Rafael Pinto Sperafico
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 18, 2019

Hi @Hassan Adel ,

Please, refer to https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering for further information.

Kind regards,
Rafael

1 vote
Rafael Pinto Sperafico
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 21, 2020

Hello,

It seems the filter requested is unavailable as per https://community.developer.atlassian.com/t/how-do-i-filter-list-of-commits-from-rest-api-v2/15805/11

Please, comment on the link above so developers can become aware of your request and potentially implement a new feature.

Kind regards,
Rafael

1 vote
Javier Aladid October 10, 2020

For what I can see, you cannot filter commits by "date". That is really a terrible lacking considering commits is the one thing you for sure want to filter as there are so many.

https://api.bitbucket.org/2.0/repositories/{ws}/{repo slug}/commits?pagelen=1&date>2020-11-12T12:12:12

Does not work, even though the object does have a "date" at it's root

If someone managed to filter commits by date, could you please help?

D20 Developer October 20, 2020

+1.

Actually your example is not 100% correct, cause according to documentation we must use something like 

https://api.bitbucket.org/2.0/repositories/{ws}/{repo slug}/commits?q=date>2020-11-12T12:12:12

and url encode it

But this didn't worked as well.

Also tried to 

1. q=values.date > YYYY-MM-DD HH:mm

2. q=values.date > "YYYY-MM-DD HH:mm"

3. q=date > "YYYY-MM-DD HH:mm"

And no result

Still trying to solve it.

aselmi87 February 26, 2022

As documented here, I've tried to replace the operators with their respective codes:

1- = is %3D

2- > is %3E

3- space is +

So the above query would be: 

https://api.bitbucket.org/2.0/repositories/{ws}/{repo slug}/commits?q=date+%3E+2020-11-12T12:12:12

 However this did not work unfortunately. Note that this worked for other endpoints which means the feature is not implemented for the commits endpoint.

 

Please vote for this to be implemented asap!

Like Mohammed Asif, Nabil likes this
Mohammed Asif, Nabil October 13, 2023

good try

0 votes
aselmi87 February 26, 2022

I followed the documentation but filtering seems to be not working for commits endpoint

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events