Snippets

Abdulrazaq Omar Custom Field searcher

Created by Abdulrazaq Omar last modified
// ==UserScript==
// @name         Jira Admin Custom Field Searcher
// @version      0.2
// @match        http*://*/*/admin/ViewCustomFields.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.$("#custom-fields th").first().append(AJS.$("<br>")).append(searchBox);
	searchBox.keyup(function() {
		AJS.$('#custom-fields>tbody>tr').css('display','none');
		AJS.$('#custom-fields td strong: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.