Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renatoch/c4a0309e2d05e103409d65225d916aef to your computer and use it in GitHub Desktop.
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
// 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