Crucible Gadget Tutorial
This tutorial will teach you how to write a simple gadget which can display information from Crucible on the JIRA dashboard.It uses the standard FishEye/Crucible REST interface to retrieve information. Other gadgets you write may need to use a REST module to retrieve the specific information they require in the most efficient way.
We encourage you to work through this tutorial. If you want to skip ahead or check your work when you are done, you can find the plugin source code on Atlassian Bitbucket. Bitbucket serves a public Git repository containing the tutorial's code. To clone the repository, issue the following command:
Alternatively, you can download the source using the Downloads page here: https://bitbucket.org/atlassian_tutorial/fecru-gadget-tutorial
Work through the Tutorial
To do this tutorial you will need an installation of JIRA 4.0 to act as the Gadget container.
First we'll write a trivial gadget which doesn't request any information from the gadget provider.
Declare the gadget in your
Then create the gadget file at
src/main/resources/gadgets/helloworld.xml. You can use any directory structure under
src/main/resources for your gadgets.
The gadget specification,
helloworld.xml contains this code:
Install your plugin into FishEye/Crucible, then add it to JIRA thus:
- Log in to JIRA as an administrator.
- Select the Dashboards, Manage Dashboards menu option.
- Click 'create new dashboard'
- Type a name in the 'Name' field and click add. (defaults are fine for everything else)
- Click on the name of your new dashboard and you'll be taken to an empty dashboard which will allow you to add gadgets.
- Click on 'add a new gadget' and click the 'Add Gadget To Directory' button – you will only see this if you are a JIRA administrator.
- Paste the URL
http://localhost:3990/fecru/rest/gadgets/1.0/g/com.example.crucible.gadget-tutorial:trivial-gadget/gadgets/helloworld.xmlinto the text field and click 'Add Gadget'.
- Your gadget will appear, highlighted in yellow, in the gadget directory. Click 'Add it Now' and then 'Finished'.
You should now see your trivial gadget on your JIRA dashboard.
To develop more complicated gadgets, see Gadget Development.