Created
June 7, 2019 02:38
-
-
Save renatoch/c4a0309e2d05e103409d65225d916aef to your computer and use it in GitHub Desktop.
Show-Hide issues like selected issue in Backlog View - Jira Next-Gen - Chrome Bookmark
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
// Copy and paste to a chrome bookmark on the URL field (chrome automatically joins line breaks) | |
// OBS: Issues are usually either in state closed / not closed. | |
// Based on currently selected issue, show/hide all other issues in similar state. | |
javascript:(function(){ | |
$ = document.querySelectorAll.bind(document); | |
function GetQueryStringParams(sParam) | |
{ | |
var sPageURL = window.location.search.substring(1); | |
var sURLVariables = sPageURL.split('&'); | |
for (var i = 0; i < sURLVariables.length; i++) | |
{ | |
var sParameterName = sURLVariables[i].split('='); | |
if (sParameterName[0] == sParam) | |
{ | |
return sParameterName[1]; | |
} | |
} | |
} | |
elemA = document.evaluate("//a[text()='" + GetQueryStringParams('selectedIssue') + "']", document).iterateNext(); | |
if (!elemA) { return; } | |
selectedClass = elemA.getAttribute("class").split(' ')[1]; | |
if (!selectedClass) { return; } | |
$("." + selectedClass).forEach(function(elem) { | |
if (!elem.parentElement.parentElement.style.visibility) { | |
elem.parentElement.parentElement.style.height = "1px"; | |
elem.parentElement.parentElement.style.visibility = "hidden"; | |
return; | |
} | |
elem.parentElement.parentElement.style.height = ""; | |
elem.parentElement.parentElement.style.visibility = ""; | |
}); | |
}) () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment