```
curl -u $BB_TOKEN https://api.bitbucket.org/2.0/repositories/comp/projname/pipelines/ | jq .values[0]
```
gives the first pipeline commit, I'd like the last one, `jq .values[-1]` will give the last one in the current page, but going to the last page isn't practical
Is there a way to sort parameter to sort pipelines descendingly?
```
curl -u $BB_TOKEN https://api.bitbucket.org/2.0/repositories/comp/projname/pipelines/?sort=-completed_on
{"error": {"message": "Bad request", "data": {"arguments": {}, "key": "rest-service.rest-service.invalid-sort-attribute"}, "detail": "Invalid sort attribute provided 'completed_on'"}}
```
it's not suuported for /pipelines https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering#query-sort, it would be very useful to do so, or sort DESC by default
Gitlab in comparison sort descendingly https://gitlab.com/gitlab-org/gitlab-ce/issues/32466#note_29989146
added a ticket: https://jira.atlassian.com/browse/BSERV-11032
Hi Cyril
Try this instead:
curl -u $BB_TOKEN https://api.bitbucket.org/2.0/repositories/comp/projname/pipelines/?sort=-created_on
Thanks,
Phil
For anyone that missed it, the key point here is the `-` in front of the `created_on`.
Here's the documentation for this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.