Last active
January 9, 2025 20:49
-
-
Save Lukas238/19ac150cfe0701739070e26daad55a23 to your computer and use it in GitHub Desktop.
Hide Closed subtask in Jira tickets
This file contains hidden or 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
// ==UserScript== | |
// @name Hide Closed subtask in Jira tickets | |
// @namespace c238 | |
// @version 1.0.0 | |
// @description Hide the closed sub task on a ticket subtask list on page load, and also fix the "Show Open" button. | |
// @author Lucas Dasso <[email protected]> | |
// @updateURL https://gist.github.com/Lukas238/19ac150cfe0701739070e26daad55a23/raw/hide_closed_subtask_in_jira_tickets.user.js | |
// @downloadURL https://gist.github.com/Lukas238/19ac150cfe0701739070e26daad55a23/raw/hide_closed_subtask_in_jira_tickets.user.js | |
// @match https://jira.*.com/browse/* | |
// @grant GM_addStyle | |
// @require http://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.min.js | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// This function hides all closed subtasks on the page | |
function hideClosedSubtasks() { | |
$('body').find('#issuetable tr.issuerow td.status').each(function () { | |
var status = $(this).text().trim().toLowerCase(); | |
if (status == 'closed') { | |
$(this).parents('tr').hide(); | |
} | |
}) | |
} | |
// Hide closed subtasks when the "Show open" button is clicked | |
$('body').on('click', '#subtasks-show-open', function () { | |
setTimeout(function () { | |
hideClosedSubtasks(); | |
}, 2000); | |
}) | |
hideClosedSubtasks(); // Hide closed subtasks on page load | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment