This server will be upgraded at 3pm Sydney time on December 3rd (December 2nd, 8pm PST) and will be down for up to 30 minutes.

JIRA Graph Plugin

This plugin may no longer be supported. I (Graham) created this plugin during the spare time of one of my co-op terms. Due to other responsibilities, I will no longer be supporting this plugin. This plugin was originally created to work with Confluence 2.6.2 and JIRA 3.11. As never versions of Confluence and JIRA are released this plugin may not work. The latest snapshot of the source code is attached to this page; feel free to edit and recompile it as needed. The project may eventually be picked back up, but for now it works as I need it to.

My apologies - Graham.

Name JIRA Graph Plugin
Version 1.2
Author Graham J Bell or Kyle Dohring
Price Free
Download JAR jira_graph-1.2.jar
Source Code (Jan 25th, 2008) jira_graph04113008.zip

What is it?

This is a not a JIRA plugin, but a Confluence plugin that displays a graph of total issues per status over time, directly from a JIRA database. It is similar to using the JIRA Charting Plugin in combination with the JIRA Portlet Macro, but was designed with a different purpose and different functionality. The JIRA Graph Plugin was not designed to replace or compete with these excellent plugins, but merely be an additional tool for developers to use if they wish.

Advantages/Disadvantages to the Charting Plugin + Portlet Macro

  • While the JIRA Charting Plugin does offer extensive functionality, it is only capable of graphing 'Created vs Resolved Issues' over 'a period of X days previous to the current date'. The JIRA Graph Plugin is capable of graphing all five of the main statuses (Created, In Progress, Reopened, Resolved, Closed) over any time range. It is also capable of combining the 'Created', 'In Progress' and 'Reopened' statuses to obtain a total of all issues that are 'Under Investigation'. More importantly it was designed specifically for Confluence and the average Confluence user, who requires little to no experience with JIRA itself. The plugin is not dependent on any other Confluence or JIRA plugins or macros.
  • The JIRA Graph Plugin is not capable of graphing using any saved filter, but does offer extensive flexibility as to which selection of issues a user wishes to graph.
  • The JIRA Graph Plugin is capable of applying weights to different priorities. Sometimes a business like to see how they are doing in regards to P1 issues being more important than P5 issues. This is sometimes referred to as a Software Quality Index (SQI) graph.
  • Changing what selection of issues are being graphed is easier with the JIRA Graph Plugin. If the Charting Plugin and Portlet Macro are being used and a Confluence user wishes to change which issues are being graphed, he/she would have to log into JIRA and create a saved filter from a massive selection of options (which can be intimidating to inexperienced users), then create the portlet in JIRA, then copy the protlet's URL and paste it in the Confluence wiki-markup. However, if the JIRA Graph Plugin is being used and a Confluence user wishes to change which issues are being graphed, he/she only needs to change the parameters being passed to the macro (see below), or simply use no parameters, which will instead cause a Java Applet GUI to run, which allows users to preview any graph without ever having to go near JIRA.
  • The JIRA Graph Plugin includes a Java Applet GUI, designed specifically for novice users. It is capable of 'previewing' any graph the macro creates without having to refresh/change the web page or go anywhere near JIRA. This can be beneficial in situations where some users may have access to the company's Confluence system, but no access to the company's JIRA system. The GUI applet also has a feature where by simply pressing a button, a popup appears with generated wiki-markup code that if copied and pasted in Confluence will result in the macro creating the same graph the applet just previewed.
  • One disadvantage is that the JIRA Graph Plugin's macro and applet to not query the database in real time, as doing so would take very long. Instead the plugin uses a cache system, where it is required to periodically query new information from the database and rebuild a cache. Once a cache is constructed, the macro and applet simply load the cache files each time they are run to generate new graphs from the files. How frequently this update occurs can be configured in the plugin's configuration screen and is at the administrator's discretion.
  • The JIRA Graph Plugin does not interact with JIRA at all, but instead queries its database. At present moment the JIRA Graph Plugin is only capable of querying SQL Server, MySQL and Oracle databases. Will likely add more capability in future versions.

Downloading & Installing

At present moment the only means to install the JIRA Graph Plugin is to download the jar file directly (if you are using Internet Explorer, please change the '.zip' extension of the file to a '.jar' extension after downloading). Then upload the file using the Confluence Administrative Console.

IMPORTANT:

The macro and applet will not run until you have successfully configured the plugin and created a cache. Once the plugin is installed you can access it's configuration screen (see screenshots below). From there you must properly configure all fields. You can click the 'Help' link to bring up a page with more information about the fields. Once the plugin is configured and you have clicked 'Update', you must build the cache. There are two ways to initiate building the cache: either try to use the macro or applet {jira_graph} in an actual Confluence page, or go to the Cache Details screen and click the 'Refresh Cache' button.

If you try to use the macro or applet before the cache exists, it will start a separate thread in the background to build the cache and return saying the cache is not ready yet (this is normal). To access the Cache Details screen go to the plugin's configuration screen, click the 'Help' link, then click the 'Cache Details' link. The Cache Details page gives more detailed information about what the cache is and when it was last updated, as well as the ability to update the cache immediately. The larger the database is, the longer the cache takes to build. The cache usually takes between 5 and 15 minutes to refresh, but could take much more or much less time, depending on the size of the database.

Macro Parameters

To run the applet instead of the macro, just add {jira_graph} with no parameters. The applet tool can help you build what graph (and what parameters) you want to use with the macro.

  • All parameters are optional. If a parameter is not specified, its default value will be assumed.
  • If no parameters are specified (or 'gui' is specified as true), then all parameters will be ignored and the GUI applet will run instead.
  • If more than one project or 'all' is specified, then the fixfor, affected and components parameters will be ignored.
  • If the priority weights are disabled in the plugin's configuration, then the weights parameter will be ignored.
Parameter Description Expected Values Default Value
gui Determines if the user wishes to use the GUI applet instead of the macro. Boolean value: true or false true
minimode Determines if the macro will display results in full, or as a mini graph. Boolean value: true or false false
type Specifies what type of graph to display (1=Bar Graph, 2=Scatter Graph, 3=Line graph with points, 4=Line graph with no points). Integer value between [1 and 4]. 3 (Line Graph with points)
dategroup Specifies how to group results (-1 = by day, -2 = by week, -3 = by month, -4 = by year). Integer value between [-1 and -4] -1 (group by day)
fgcolor Specifies what color the borders and text in the graph will be. Six-character hexadecimal number. 000000 (black)
bgcolor Specifies what color the background of the graph will be. Six-character hexadecimal number. FFFFFF (white)
priorities Specifies the macro to only count issues with desired priorities. Comma-separated list of integers, or '*' or 'all'. all
groupstatus Determines if the 'Created', 'In Progress' and 'Reopened' statuses should be combined as 'Under Investigation'. Boolean value: true or false false
cumulative Determines if totals will be cumulative or not. Boolean value: true or false false
weights Determines if weighted values will be applied to priorities. Boolean value: true or false false
projects Specifies the macro to only count issues belonging to desired projects. Comma-separated list of project keys, or '*' or 'all'. all
fixfor Specifies the macro to only count issues in the desired project belonging to desired fixfor versions. Comma-separated list of fixfor versions, or '*' or 'all'. all
affected Specifies the macro to only count issues in the desired project belonging to desired affected versions. Comma-separated list of affected versions, or '*' or 'all'. all
components Specifies the macro to only count issues in the desired project belonging to desired components. Comma-separated list of components, or '*' or 'all'. all
start Specifies what date the date range for issues should start on. If empty or not specified, the macro will use the earliest date any issue was created. Valid date in the format of 'DD/MM/YYYY', or the empty string. Only numbers and slashes - no letters. An empty string
end Specifies what date the date range for issues should end on. If empty or not specified, the macro will use the latest date any issue had it's status changed. Valid date in the format of 'DD/MM/YYYY', or the empty string. Only numbers and slashes - no letters. An empty string

Example Usage

{jira_graph} Runs the GUI Applet tool instead of the macro.
{jira_graph|gui=false} Runs the macro and displays totals for all issues over the entire history (by day).
{jira_graph|gui=false|start=01/01/2007} Runs the macro and displays totals for all issues from 'Jan 1st, 2007' to 'today' (by day).

Different Modes

The plugin is capable of running in three modes. The 'gui' and 'minimode' parameters will determine which of these modes it runs in. The first is the GUI Applet tool which can preview any graph but does not save which graph the user was viewing. The second is the macro in full mode which displays a large, highly-detailed graph as well as tables of the statistical information and search parameters. The third is the macro in mini-mode, which displays a mini-graph and a value, that will either represent the maximum or 'final graph value' of each status (depending on whether cumulative is true/false). The gallery below contains one screenshot of each of these modes.

In mini-mode you can mouse-over for more information. Both full and mini-mode versions of the macro offer the ability to download the statistics table as a comma-separated value (CSV) file, by clicking the image.

Gallery

Changelog

Version 1.2

Support Changes:

  • Added support for JIRA's database structure in version 3.7 and higher

Version 1.1

Bug Fixes:

  • Fixed null pointer error when cache files do not exist
  • Fixed problem that allowed multiple update threads to run at once

Labels

jiragraph jiragraph Delete
jira_graph jira_graph Delete
plugin plugin Delete
macro macro Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Dec 11, 2007

    Gerhard Gahle says:

    I missing the documentation for this plugin. What does it solve exactly, syntax,...

    I missing the documentation for this plugin. What does it solve exactly, syntax,....

    I am currently using the jiraportlet macro, which solves also most of my problems.

    1. Dec 13, 2007

      Graham Bell says:

      Sorry about that. This is my first plugin and am still working to add it and sou...

      Sorry about that. This is my first plugin and am still working to add it and source code to the repository. Planning to add screenshots in next day or so. Hope what I've posted helps.

  2. Dec 20, 2007

    jd lima says:

    I'm surprised this plugin doesn't talk to a PostgreSQL JIRA database? Does the ...

    I'm surprised this plugin doesn't talk to a PostgreSQL JIRA database?

    Does the plugin respect any JIRA permissions?

    Looks like an interesting plugin (if I can get it to talk to our JIRA DB
    Cheers,
    -jd.

  3. Jan 15, 2008

    Vincent Eggen says:

    Tested with COnfluence 2.7 Entreprise and got a NPE when updated the Cache file:...

    Tested with COnfluence 2.7 Entreprise and got a NPE when updated the Cache file:

    java.lang.NullPointerException
    	at com.atlassian.confluence.extra.jiragraph.config.JIRAGraphCacheAction2.execute(JIRAGraphCacheAction2.java:60)
    	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168)
    	at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
    	at com.atlassian.confluence.util.LoggingContextInterceptor.intercept(LoggingContextInterceptor.java:48)
    	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
    

    Any idea ?

    Thanks

  4. Jan 23, 2008

    Matt Doar says:

    Nice plugin! How do you extract the historical information from JIRA? Do you par...

    Nice plugin! How do you extract the historical information from JIRA? Do you parse the entries in the change logs.

    1. Jan 25, 2008

      Graham Bell says:

      The plugin contains its own custom-made data structure. It uses simple JDBC to q...

      The plugin contains its own custom-made data structure. It uses simple JDBC to query the SQL database for everytime any status change occured. For every status change, several minor queries are performed to find out what issues the change was for, what project the issue is in, etc... Then it parses the information into the data structure. Basically there is one massive ArrayList of special objects which represent projects, each of which contains ArrayLists of different special object that represent issues. Afterwards, the entire data structure is written to a basic ascii text file. When the plugin runs, it just loads the text file, parses it and displays results as needed. More information can be found in this attached screenshot.

      Unfortunately, this means that when data is refreshed (every hour, day, week, etc), then the entire collection must be completely replaced. While this seems like a waste, it was the quickest way for the plugin to load and parse data during runtime.

      BTW: Sorry for what probably seems like I've been ignoring everything. I programmed the plugin during my spare time while on co-op. I just started going back to classes and am extremely busy. Kyle has been a great help and will probably be taking over for a little while. I'll do what I can when I have spare time.

  5. Jan 25, 2008

    Kyle Dohring says:

    Hey everyone, I'm kinda helping out with this plugin. I'll let Graham know abou...

    Hey everyone, I'm kinda helping out with this plugin. I'll let Graham know about these questions here, but I can easily answer your concern Vincent: there used to be a bug where if there were no cache files currently on the machine, it would generate that error in certain circumstances. I fixed that, along with one other bug that I've noted above.

    1. Jan 25, 2008

      Vincent Eggen says:

      Thanks for that. I made a quick test on V1.1. And got the following error: j...

      Thanks for that.

      I made a quick test on V1.1.
      And got the following error:

      jira_graph: ERROR BUILDING PROJECT STRUCTURE com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: 
      Table 'jira.version' doesn't exist com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
      com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985) com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631) 
      com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723) com.mysql.jdbc.Connection.execSQL(Connection.java:3256) 
      com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313) 
      com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1448) 
      com.atlassian.confluence.extra.jiragraph.tools.JIRADataParser.createProjectManager(JIRADataParser.java:81) 
      com.atlassian.confluence.extra.jiragraph.tools.JIRADataParser.UpdateProjectData(JIRADataParser.java:48) 
      

      We are on Jira 3.11, MySQL 5.0.28
      Your help is welcome.

      Vince

      1. Jan 25, 2008

        Kyle Dohring says:

        (Keep in mind I know next to nothing about confluence and jira, I was just put t...

        (Keep in mind I know next to nothing about confluence and jira, I was just put to task updating a few details and making a few bug fixes)
        It looks like either you didn't configure the plugin correctly (as in you have the database name (or possibly server) wrong), or somehow your database structure is different than the one that this plugin was developed against.

        It's looking for a table called "version" where it tries to pull out a version name for a particular project ID.

        Do you have access to the underlying database of your JIRA distribution to check this out?

        For the record, the query being run is:
        SELECT DISTINCT vname FROM version WHERE PROJECT = (Project ID)

        1. Jan 25, 2008

          Vincent Eggen says:

          Well, I checked the Jira db model: there is no version table. Sounds like some ...

          Well,

          I checked the Jira db model: there is no version table.
          Sounds like some aliasing is sued to perform the task, no ?

          Did you validate this version over Mysql as well ?

          Vince

          1. Jan 25, 2008

            Vincent Eggen says:

            Actually, the table where project versions can be retrieved is named "projectver...

            Actually, the table where project versions can be retrieved is named "projectversion"

            Which version of Jira are you using to run this plugin ?

            Vince

            1. Jan 25, 2008

              Kyle Dohring says:

              3.6.2 -#156 apparently. I might have to talk to graham about changing this so yo...

              3.6.2 -#156 apparently.
              I might have to talk to graham about changing this so you can specify table names.

              In other news, I'm just about to upload the source code (and some other junk I couldn't be bothered sorting through and removing), so if anyone is interested in looking into the inner workings of this plugin, or building yourself a version/making changes, you can.

              1. Jan 25, 2008

                Vincent Eggen says:

                Okay. Jira Graph is unfortunatelly not compatible with Jira 3.7+: http://confl...

                Okay. Jira Graph is unfortunatelly not compatible with Jira 3.7+:

                http://confluence.atlassian.com/display/JIRA/JIRA+3.7+Database+Schema+Changes http://confluence.atlassian.com/display/JIRA/JIRA+3.8+Database+Schema+Changes

                I'll have a look in the code and see what I can do.
                Thanks for your help.

                I'll keep you in touch.

                Vince

  6. Feb 05, 2008

    Kyle Dohring says:

    Okay, Vincent's problem has been dealt with. Of all the tables to change, they ...

    Okay, Vincent's problem has been dealt with. Of all the tables to change, they change that one...
    Well, 1.2 should do you well.

    1. Feb 05, 2008

      Vincent Eggen says:

      Thanks for your efforts. I made a quick test on 1.2, Jira 3.11, Confluence 2.7 ...

      Thanks for your efforts.

      I made a quick test on 1.2, Jira 3.11, Confluence 2.7 and got a OutOfMemoryError...

      Exception in thread "DefaultQuartzScheduler_Worker-4" java.lang.OutOfMemoryError: Java heap space
      	at java.util.LinkedList.<init>(LinkedList.java:78)
      	at java.util.LinkedList.<init>(LinkedList.java:97)
      	at org.quartz.core.QuartzScheduler.getGlobalTriggerListeners(QuartzScheduler.java:1430)
      	at org.quartz.core.QuartzScheduler.buildTriggerListenerList(QuartzScheduler.java:1500)
      	at org.quartz.core.QuartzScheduler.notifyTriggerListenersFired(QuartzScheduler.java:1533)
      	at org.quartz.core.JobRunShell.notifyListenersBeginning(JobRunShell.java:307)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:184)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
      Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2" java.lang.OutOfMemoryError: Java heap space
      Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0" java.lang.OutOfMemoryError: Java heap space
      Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1" java.lang.OutOfMemoryError: Java heap space
      Exception in thread "JiraDataParser" java.lang.OutOfMemoryError: Java heap space
      

      I'll investigate a little bit further and keep you in touch...

      Vince

  7. Apr 02, 2008

    Benjamin Heisch says:

    I also get an DB-Exception. jira_graph: ERROR BUILDING PROJECT STRUCTURE java....

    I also get an DB-Exception.

     jira_graph: ERROR BUILDING PROJECT STRUCTURE
    java.sql.SQLException: ORA-00942: table or view does not exist
    

    We are using confluence 2.7.2 and JIRA 3.12.2-#300 - both upgraded from older versions.

    Is there a resolution for the shema-uncompability?

    Best regards... Benjamin

  8. May 26, 2008

    Daniel Weber says:

    @Benjamin: This error occurs because of a database scheme change in jira. I modi...

    @Benjamin: This error occurs because of a database scheme change in jira. I modified the sources so that it will function with the database scheme of jira 3.10.2. I will upload the modified sources here.

    Sorry i can't upload anything. I don't have the permission.. if somebody can give it to me, i upload my modified version.

    regards 

    daniel