JIRA Plugin Guide

JIRA Documentation

Index

JIRA includes a plugin system that enables developers to write plugins which enhance JIRA's functionality in various ways.

Setting up a Plugin Project

Please refer to How to build an Atlassian Plugin to set up your development environment and create a plugin template.

A Plugin Overview

A JIRA plugin is a single JAR containing code, a plugin descriptor (XML) and usually some Velocity template files to render HTML.

The plugin descriptor is the only mandatory part of the plugin. It must be called atlassian-plugin.xml and be located in the root of your JAR file.

Each plugin consists of one or more plugin modules. These are of different types (for example a report, or a portlet) and each has an individual XML element describing it. Each module is described below together with the XML element required for it.

Here is a sample of the descriptor with highlighted elements:

<!-- the plugin key must be unique, think of it as the 'package' of the plugin -->
<atlassian-plugin key="com.atlassian.plugin.sample" name="Sample Plugin">
    <!-- a short block describing the plugin itself -->
    <plugin-info>
        <description>This is a brief textual description of the plugin</description>
        <!-- the version of the plugin -->
        <version>1.1</version>
        <!-- the versions of the application this plugin is for -->
        <application-version min="3.0" max="3.0"/>
        <!-- details of the plugin vendor -->
        <vendor name="Atlassian Software Systems Pty Ltd" url="http://www.atlassian.com"/>
    </plugin-info>

    . . . 1 or more plugin modules . . .
</atlassian-plugin>

Each plugin has a plugin key which is unique among all plugins (eg "com.atlassian.plugin.sample"). Semantically this equates to the package of a Java class. Each module within the plugin also has a module key which is unique within the plugin (eg "myreport"). Semantically this equates to the class name of a Java class.

The plugin key + module key are combined to make the complete key of the plugin module (combining the examples above, the complete key would be "com.atlassian.plugin.sample:myreport"). Note: a : is used to separate the plugin key from the module key.

JIRA Plugin Module Types

The following types of plugin modules are supported by JIRA

Module Type Since version... Documentation Description
portlet 3.0 Portlet Plugin Module Add new portlets to JIRA
report 3.0 Report Plugin Module Add new reports to JIRA
customfield-type 3.0 Custom Field Plugin Module Add new types of fields to JIRA
customfield-searcher 3.0 Custom Field Plugin Module Add new types of field searchers to JIRA
project-tabpanel 3.0 Project Tab Panel Plugin Module Add new tabs to the Browse 'Project' screen
component-tabpanel 3.10 Component Tab Panel Plugin Module Add new tabs to the Browse 'Component' screen
version-tabpanel 3.10 Version Tab Panel Plugin Module Add new tabs to the Browse 'Version' screen
issue-tabpanel 3.0 Issue Tab Panel Plugin Module Add new tabs to the View Issue screen
issue-operation 3.4 Issue Operations Plugin Module Add new operations to the View Issue screen
resource 3.5 Downloadable Plugin Resources Downloadable resources from within any plugin
servlet 3.5 Servlet Plugin Module A standard Java servlet deployed within a JIRA plugin
webwork 3.1 Webwork plugin module XWork/Webwork actions and views bunded with a plugin, enabling user interaction
component 3.0 Component Plugin Module Adds components to JIRA's component system
rpc-soap 3.0 RPC Endpoint Plugin Module Deploys a SOAP service within JIRA
rpc-xmlrpc 3.0 RPC Endpoint Plugin Module Deploys an XML-RPC service within JIRA
workflow-condition 3.0 Workflow Plugin Modules Add new conditions to the JIRA workflow
workflow-validator 3.0 Workflow Plugin Modules Add new validations to the JIRA workflow
workflow-function 3.0 Workflow Plugin Modules Add new post functions to the JIRA workflow
web-item 3.7 Web UI Plugin Module Add new links into the Jira web interface
web-section 3.7 Web UI Plugin Module Add new tabs/sections into the Jira web interface

Built-in JIRA system plugins

A number of functions and areas within JIRA 3 are shipped as built in plugins. These can also be useful for plugin developers who want to know more about how to create their own plugins, as they showcase the functionality that can be built.

The system plugins are referenced from the following files (located in /WEB-INF/classes:

  • system-workflow-plugin.xml - the built in workflow conditions, validators and functions.
  • system-customfieldtypes-plugin.xml - the built in custom field types.
  • system-project-plugin.xml - the built in project tab panels (ie roadmap, change log and popular issues).
  • system-reports-plugin.xml - the built in system reports (ie time tracking and developer workload reports).
  • system-portlets-plugin.xml - all of the built in system portlets.

Deploy a JIRA Plugin

Installing plugins in JIRA is easy.

Once you have downloaded or created your plugin jar, follow these steps:

  1. Shut down JIRA
  2. copy '$MY_COOL_PLUGIN.jar' into '.../atlassian-jira/WEB-INF/lib/'
  3. Start up JIRA.
  4. Go to 'Administration > Plugins' and confirm that $MY_COOL_PLUGIN is listed and enabled.
  5. Enjoy!

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Sep 16, 2004

    William Crighton says:

    I have a group of modules I'm extending JIRA with and they all fit into a JIRAEx...

    I have a group of modules I'm extending JIRA with and they all fit into a JIRAExtensions.jar, which to make available I've just copied into <jira dir>/WEB-INF/lib, and restarted the app server. Now, I believe I can make some of the modules plug-ins with the instructions above and just put the atlassian-plugin.xml in the root of the jar file. Will I still 'deploy' the same way, by copying the jar to the WEB-INF/lib directory, or will I need to do something else with it? Also, I'm hoping to leave the plug-in and non-plug in modules side-by-side in the resulting jar file - will this work still?

    1. Sep 16, 2004

      Mike Cannon-Brookes says:

      Yes the plugin JAR simply needs to be put into WEBINF/lib (or anywhere else in t...

      Yes - the plugin JAR simply needs to be put into WEB-INF/lib (or anywhere else in the WAR classpath).

      And yes, you can include other classes into this JAR at the same time.

  2. Oct 18, 2004

    Mike Aizatsky says:

    Can resources be part of plugin?

    Can resources be part of plugin?

    1. Jan 03, 2005

      Mike Cannon-Brookes says:

      Resource serving has just been added to the plugin system, and will be released ...

      Resource serving has just been added to the plugin system, and will be released first with Confluence 1.3. There is a brief guide to these in the Confluence plugins intro, see the resources of type "download".

  3. Oct 18, 2004

    Mike Aizatsky says:

    Test plugin also uses another format for velocity plugin declaration: <templa...

    Test plugin also uses another format for velocity plugin declaration:

    <template type="velocity" name="view" location="/foo/bar/display.vm" />

    Which one is right?

    1. Oct 18, 2004

      Mike Cannon-Brookes says:

      Velocity resources should always be specified using the {{<resource>>}} tag. Whe...

      Velocity resources should always be specified using the <resource>> tag. Where did you see the template tag used?

  4. Oct 18, 2004

    Mike Aizatsky says:

    Can you please add javadocs for methods in WorkflowPluginFactory and similar?

    Can you please add javadocs for methods in WorkflowPluginFactory and similar?

    1. Oct 18, 2004

      Mike Cannon-Brookes says:

      JavaDocs and a full tutorial of how to write workflow plugins is coming. For no...

      JavaDocs and a full tutorial of how to write workflow plugins is coming.

      For now, Vincent Massol has written an excellent tutorial on his blog about how to write a workflow plugin properly.

  5. Sep 11, 2007

    David Israel Laks says:

    Hello, Recently I create a plugin for Jira 3.10, and I have one Jar file and 2 J...

    Hello,

    Recently I create a plugin for Jira 3.10, and I have one Jar file and 2 Jsps files. I like to add these jsps in the jar file, I can access the jsps files to download, but the action don't work with the same url, can you help me to resolve this problem?

    Regards,
    David Laks

    1. Jan 15, 2008

      Vincent Thoulé says:

      Hi David, I have already to find a way to access embedded JSP in a JAR, and did...

      Hi David,

      I have already to find a way to access embedded JSP in a JAR, and did not find a way to do it. I successed to implemented action coded through Velocity page. (See my plugin source ).

      I think, a such feature will be possible by overriding WebWork engine ?!

      If you success to find a way to do it, let us know !
      Rgds

  6. Jan 31

    Malathi Thangavelu says:

    HI We have created few plugins, Please let me know what all has to be taken care...

    HI
    We have created few plugins, Please let me know what all has to be taken care / modified, while copying those files from olderversion of jira to a newer version ?

     We have also checked the atlassian upgrade guidelines, but didn't get the solution.

    Please let me know whether any code change is required for compatibility ?

     Thanks

    1. Feb 04

      Jonathan Nolen says:

      I've written up some notes about the upgrade process here DEVNET:Best Practices ...

      I've written up some notes about the upgrade process here

  7. Feb 25

    Ben says:

    I was planning on writing a plugin that allows for all issues within specific co...

    I was planning on writing a plugin that allows for all issues within specific components to be automatically displayed to all members of a certain user group while still having the ability to assign only certain users the rights to that project.

     For example: if the issue falls under the component named Installer and i set it to where only administrators can see the issue, i still want anyone in the user group Developers able to see the issue by default because it handles under the Installer component.

    When i looked i could not find any documentation on this idea, does anyone know where i would start looking for something along these lines?