What happened with search history?

Just upgraded from 5.0 to 5.2.6. The new search interface was announced to be a big highlight.

However, I can't see that we gain that much. People just need to re-learn.

A big disappointment is that my search history, with my recent JQL searches, has disappeared. It was a very useful function. Why is it removed? Or is it around somewhere else?

11 answers

1 accepted

Wrote a quick script which can help you to JQL history (even though it won't be synchronized across all browsers/machine that you use). Just uses the local storage.

Put this into the announcement banner and you will be good to go (tested on JIRA 6.1.1):


EDIT: Minor changes for the order of items

<script type='text/javascript'>
var refreshJqlHistoryPane = function() {
	var localHistory = localStorage.getItem('jqlHistory');
	if(localHistory){
		var history = JSON.parse(localHistory);
		var historyEntries = history.map(function(jql){
			var display = jql;
			if(display.length > 25){
				display = display.substr(0,22) + "...";
			}
			return '<li><a href="'+ AJS.contextPath() + '/issues/?jql=' + encodeURIComponent(jql)  + '">' + display + '</a></li>';
		});
		var historyBlock = '<nav class="aui-navgroup aui-navgroup-vertical"><div id="jql-history-panel"><div class="aui-nav-heading"><strong>JQL History</strong></div>' + 
		'<ul class="aui-nav">' + 
			historyEntries.join("") + '</ul></div></nav>';

		if(AJS.$('#jql-history-panel')){
			AJS.$('#jql-history-panel').remove();
		}
		AJS.$(AJS.$('.filter-panel-section')[0]).after(historyBlock);
	}
}

var handleJqlSearch = function(){
	JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(){
		var currJql = AJS.$('#advanced-search').val();
		if(null != currJql && currJql !== "")
		{
			var rawdata = localStorage.getItem('jqlHistory');
			var history;

			if(rawdata){
				history = JSON.parse(rawdata);
				var lastJql = history[0];
				if(lastJql != currJql){
					history.unshift(currJql);
				}
				if(history.length > 10){
					history.pop();
				}
			}
			else{
				history = new Array();
				history.push(currJql);
			}
			localStorage.setItem('jqlHistory', JSON.stringify(history));
		}
		refreshJqlHistoryPane();
	});
}

AJS.$(document).ready(function() {
	if(AJS.$('#advanced-search')) {
		handleJqlSearch();
	}
});
</script>


That's pretty smart!

Agree, it works fine!

However, I would like to see the feature reintroduced

Elegant solution - I have improved it in this gist with

  • tooltip with full JQL
  • smarter removing of duplicates
3 votes

It's not around anywhere else, they removed it because they said it wasn't used much.

BTW, when they say things like this it's based on metrics from AOD, which have very different user patterns from the hosted instances.

I agree with you, I used it a lot and miss it.

I too miss it. You can't expect people to save every single search as filter. Especially when trying things out.

Well, there's a reason not to upgrade. I use that feature all the time.

Please Atlassian, reintroduce this feature.

I can see why cloud users would not use this. However, JIRA server users with multiple enterprise licenses who pay lots of $$$ should maybe also have a say here...

Well. the search history is actually there - just hit back button (or access the context menu on the back button). Or hit Ctrl-H and filter by ?jql=.

Not the same level of functionality at all!

There are two distinct worlds of JIRA users - those accustomed with JQL syntax and the others.

I was for long time hesitating to upgrade to version 5.2 for our company (and customers), when an user recalls me what a poor experience is simple search in pre-5.2 version. For those users using simple search is 5.2 the blessing (and they really never used the JQL history and don't miss it).

I miss it as well. Especially since you can't have two searches in a single session. It's very annoying to make a complicated JQL search and to have it blown because you needed to search for something else.

THis is crazy!! jeeeeze.. Put it back.

What? Use Ctrl-H? Gotta be kidding me.

I should have cornered someone at Summit and bribed/forced them to put it back!

Wrote a quick script which can help you to JQL history (even though it won't be synchronized across all browsers/machine that you use). Just uses the local storage.

Put this into the announcement banner and you will be good to go:

<script type='text/javascript'>
var refreshJqlHistoryPane = function() {
	var localHistory = localStorage.getItem('jqlHistory');
	if(localHistory){
		var history = JSON.parse(localHistory);
		var historyEntries = history.map(function(jql){
			var display = jql;
			if(display.length > 25){
				display = display.substr(0,22) + "...";
			}
			return '<li><a href="'+ AJS.contextPath() + '/issues/?jql=' + encodeURIComponent(jql)  + '">' + display + '</a></li>';
		});
		var historyBlock = '<nav class="aui-navgroup aui-navgroup-vertical"><div id="jql-history-panel"><div class="aui-nav-heading"><strong>JQL History</strong></div>' + 
		'<ul class="aui-nav">' + 
			historyEntries.join("") + '</ul></div></nav>';

		if(AJS.$('#jql-history-panel')){
			AJS.$('#jql-history-panel').remove();
		}
		AJS.$(AJS.$('.filter-panel-section')[0]).after(historyBlock);
	}
}

var handleJqlSearch = function(){
	JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(){
		var currJql = AJS.$('#advanced-search').val();
		if(null != currJql && currJql !== "")
		{
			var rawdata = localStorage.getItem('jqlHistory');
			var history;

			if(rawdata){
				history = JSON.parse(rawdata);
				var lastJql = history[history.length - 1];
				if(lastJql !== currJql){
					history.push(currJql);
				}
			}
			else{
				history = new Array();
				history.push(currJql);
			}
			localStorage.setItem('jqlHistory', JSON.stringify(history));
		}
		refreshJqlHistoryPane();
	});
}

AJS.$(document).ready(function() {
	if(AJS.$('#advanced-search')) {
		handleJqlSearch();
	}
});
</script>

We just upgraded (or downgraded if you liked to use search history) about a month ago, and it is the first thing I noticed was missing. Really a pain in the neck to have to save a filter now, where before I could simply click on the previous searches.

Removing this feature was a bad call. Was there some big overhead to maintain the feature??? Many on my team and I hope it will be added back in.

Atlassian is weird. Such a basic and great feature, now gone. I just lost a really complex search query because I clicked on a label by accident. Now my last search is the one for the label *doh*

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

231 views 2 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you