Modifying Gadgets refresh interval

Still need help?

The Atlassian Community is here for you.

Ask the community

This is a customization not supported by Atlassian. It was not heavily tested it and we are unaware of side-effects that it may cause. Do it at your own risk.

The modifications on this page are based in JIRA 5.0.4 and not tested on other versions. Filenames may be different in other versions.

You may want to modify the refresh interval of JIRA's Dashboard Gadgets. 

Modification of a couple of files are required:

Steps:

Before you start:

  • Stop your JIRA instance.

Modifications in the files:

  • Open the atlassian-gadgets-publisher-plugin-3.1.21.jar located in JIRA-INSTALL/atlassian-jira/WEB-INF/classes/atlassian-bundled-plugins.zip.
    (info) In order to open the .jar file, rename it to .zip and decompress it. 
    (the JAR is located in the JIRA-INSTALL/atlassian-jira/WEB-INF/atlassian-bundled-plugins/ folder in JIRA 7.x)
  • Inside it, you have to modify two files under the ajs-gadgets folder (as of JIRA 6.x, the path is ajs-gadgets/gadgets)
    • ajs.gadget.configurable.js
    • ajs.gadget.configurable-min.js
  • Look for the following excerpt: 

    options: [
    	{value: "false", label: gadget.getMsg("gadget.common.refresh.never")},
    	{value: "15", label: AJS.format(gadget.getMsg("gadget.common.refresh.minutes"), 15)},
    	{value: "30", label: AJS.format(gadget.getMsg("gadget.common.refresh.minutes"), 30)},
    	{value: "60", label: AJS.format(gadget.getMsg("gadget.common.refresh.hour"), 1)},
    	{value: "120", label: AJS.format(gadget.getMsg("gadget.common.refresh.hours"), 2)}
     ],
  • Inside the options you can add or remove options for refresh intervals.
  • After modifying the values in both files, save it and compress the plugin directory.
    (info) Don't forget to rename the .zip files to .jar.
  • Add the file back to the atlassian-bundled-plugins.zip.
  • To make sure that you will get fresh bundled plugins, remove all contents of $JIRA_HOME/plugins/.bundled-plugins.

Modifying the current values set for existing Gadgets:

If you also wish to modify the current values that users may have for the refresh interval of their Gadgets, you need to modify it directly in the database:

(warning) Backup your database first. In the case of problems, you can rollback!

Update the userprefvalue column of the gadgetuserpreference table where the userprefkey is 'refresh' to change the refresh interval of the gadgets (note that this is defined per gadget).

  • Start JIRA back

Last modified on Mar 17, 2017

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.