Last active
August 29, 2015 13:56
-
-
Save RomiC/8998420 to your computer and use it in GitHub Desktop.
Sort subtasks in JIRA by their status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var statusPriorites = { | |
"На тестирование": 1, | |
"Включить в деплой": 2, | |
"Открыт": 3, | |
"Ожидает допостановки": 4, | |
"В деплое": 5, | |
"Закрыт": 6 | |
}; | |
function SortIssues(i1, i2) { | |
/** | |
* Geting issues status priorites | |
* Unknown status getted the lowest priority | |
*/ | |
var st1 = statusPriorites[$(".status img", i1).attr("alt")] || statusPriorites.length; | |
var st2 = statusPriorites[$(".status img", i2).attr("alt")] || statusPriorites.length; | |
return st1 < st2 ? -1 : (st1 > st2 ? 1 : 0); | |
}; | |
function UpIssuePosition() {}; | |
var issues = $(".issuerow"); | |
if (issues.length) { | |
issues.sort(SortIssues); | |
$.each(issues, function() { console.log($(".status img", this).attr("alt"));}); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment