JIRA, Technical

Embed Page Refresh

Feature request that certain JIRA dashboards should reload more frequently than every fifteen minutes. So, I cooked up some JavaScript to hide in the announcement banner:

<script type="text/javascript">
function gup( name ){
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
 if( results == null )    return "";
else    return results[1];}
function reload() {
 window.location = window.location
var refresh = gup('refresh');
if ( refresh > 0 )    window.setInterval(reload, refresh*1000);

Now users can add refresh=nn and the page will reload every nn seconds. This ought to work in most cases where you can sneak some HTML into a Web App.

Function gup stolen from http://stackoverflow.com/questions/979975/how-to-get-the-value-from-url-parameter.

Read More

Categories: JIRA, Technical