Allow sorting of the pull request list by columns other than last updated

Issue #8711 open
Bitbucket Bot
created an issue

As the title states. Allow sorting by things other than the current forced order of last updated. This could be PR number, open date or even author.

Comments (15)

  1. Victor Yap

    One "workaround" for this is, simply going to the "branches" page. There, pull requests are sorted by branch. You'll be missing the columns for pull request statistics, but, at least the items won't constantly re-order themselves in a madly chaotic dance.

  2. Victor Yap

    ಠ ̨ರೃ —「JavaScript, JavaScript. Does whatever a JavaScript does. Can it swing from a web? No, it can't, it's a JavaScript.」

        document.bitbucket_augment = {
            sort_pull_requests_by_title: function(){
                var rows = $("table.pullrequest-list tbody tr");
                sorted = rows.sort(function(a,b){
                    var a_txt = $(a).find(".title div a").text().substring(6);
                    var b_txt = $(b).find(".title div a").text().substring(6);
                    return a_txt > b_txt;
                sorted.each(function(i, elem){
                    $("table.pullrequest-list tbody").append(elem);
        var filter_control = $("ul.filter-control")
            filter_control.append('<li><a href="#sort_by_title" onclick="document.bitbucket_augment.sort_pull_requests_by_title(); return false;">Sort By Title</a></li>');

    There, I fixed it.

    The above JavaScript can also be injected using brower extensions, such as "Custom JavaScript for Websites" for Chrome.

  3. AYI

    Neither javascripts worked for me unfortunately, tried to inject as suggested with "Custom JavaScript for Websites". No changes on PR page.

  4. Adam "Atlassian" Steiner

    We often have Pull requests from branches that include commits from other branches (that are also in pull requests).

    Sorting by PR number would make it easier for us to tackle reviews in order, so that we're not reviewing the same code twice.

  5. Victor Yap

    I believe that BitBucket's site structure changed since I wrote that JavaScript, thus breaking its functionality. At least the status changed to "open" today so maybe we'll see a permanent solution in the near future!

  6. Log in to comment