Snippets

Abdulrazaq Omar Issue Type Search

Created by Abdulrazaq Omar
// ==UserScript==
// @name         Jira Admin Issue Type Searcher
// @match        http*://*/*/admin/ViewIssueTypes.jspa
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // create case-insensitive text selector
    jQuery.expr[":"].icontains = function(obj,index,meta) {
        return jQuery(obj).text().toUpperCase().indexOf(meta[3].toUpperCase()) >= 0;
    };

    var searchBox = AJS.$("<input type='text' placeholder='search...'>");
    AJS.$("#issue-types-table th").first().append(AJS.$("<br>")).append(searchBox);
    searchBox.keyup(function() {
        AJS.$('#issue-types-table>tbody>tr').css('display','none');
        AJS.$('#issue-types-table strong[data-issue-type-field]:icontains("' + this.value + '")').each(
            function() { 
                AJS.$(this).parent().parent().css('display',''); 
            }
        );
    });
})();

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.