Sort pipelines descendingly, or add sort parameter

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Incorrectly Filed
    • None
    • Component/s: API - REST
    • None

      Currently pipelines endpoint return pipelines in chronological order

       

      curl -u $BB_TOKEN https://api.bitbucket.org/2.0/repositories/comp/projname/pipelines/ | jq .values[0]
      

      But, it's mainly interesting to get the last one (`jq .values[-1]` will give the last one in the current page, but going to the last page isn't practical)

       

      `sort` querystring is not supported for /pipelines https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering#query-sort, so it would be very useful to implement it, or sort DESC by default if backward compatibility isn't an issue

       

      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'"}}

       

      Gitlab in comparison sort descendingly https://gitlab.com/gitlab-org/gitlab-ce/issues/32466#note_29989146

       

      The goal is to test if some directories changed since last pipeline, it's possible in gitlab-api like this: https://gitlab.com/gitlab-org/gitlab-ce/issues/19813#note_92434137

            Assignee:
            Unassigned
            Reporter:
            caub_
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: