Skip to content

Instantly share code, notes, and snippets.

@realdadfish
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save realdadfish/b76805e82c991ebe2e42 to your computer and use it in GitHub Desktop.

Select an option

Save realdadfish/b76805e82c991ebe2e42 to your computer and use it in GitHub Desktop.
JIRA Rapid View Exclusive Filter
// ==UserScript==
// @name Single-click filter selection
// @namespace http://thomaskeller.biz
// @version 0.1
// @description Exclusively selects a filter from the configured list of filters amongst the others (i.e. deselects the others).
// @author You
// @match https://your.jira.server/secure/RapidBoard.jspa?rapidView=*
// @grant none
// ==/UserScript==
(function() {
// IDs of the filter options that should be selected exclusively
var filterIDs = [121,122,123,124,125,126,176,492];
jQuery(".js-quickfilter-button").live("click", function(ev) {
var $el = jQuery(ev.target);
if ($el.hasClass("ghx-active")) {
for (i=0; i<filterIDs.length; ++i) {
if ($el.data("filter-id") == filterIDs[i]) {
continue;
}
jQuery(".js-quickfilter-button.ghx-active[data-filter-id=" + filterIDs[i] + "]").click();
}
}
});
})(jQuery | AJS.$);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment