Sort JIRA comments ascending (oldest first).

Always sort JIRA comments ascending.

2016-07-11 يوللانغان نەشرى. ئەڭ يېڭى نەشرىنى كۆرۈش.

// ==UserScript==
// @name         Sort JIRA comments ascending (oldest first).
// @namespace    http://stevekehlet.com
// @version      0.1
// @description  Always sort JIRA comments ascending.
// @author       Steve Kehlet
// @match        https://jira.atlassian.com/browse/*
// ... include more match statements here, including your private JIRA repos, example:
// @match        https://devtools.yourcompany.com/jira/browse/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var sortLinks = document.getElementsByClassName('issue-activity-sort-link');
    if (sortLinks && sortLinks.length > 0) {
        for (var i = 0; i < sortLinks.length; i++) {
            var sortLink = sortLinks[i];
            if (sortLink.getAttribute('data-order') == 'desc') {
                sortLink.click();
            }
        }
    }
})();