Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
JIRA Development Cookbook
JIRA Development Cookbook

JIRA Development Cookbook: Develop and customize plugins, program workflows, work on custom fields, master JQL functions, and more to effectively customize, manage, and extend JIRA

eBook
NZ$69.99 NZ$77.99
Paperback
NZ$96.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

JIRA Development Cookbook

Chapter 2. Understanding Plugin Framework

In this chapter, we will see more details on the JIRA Architecture and the plugin framework. We will also see the following recipes:

  • Converting plugins from v1 to v2

  • Adding resources into plugins

  • Adding web resources to the plugin

  • Building JIRA from source

  • Adding new webwork actions to JIRA

  • Extending a webwork action in JIRA

Introduction


As we saw in the previous chapter, the JIRA plugin development process is probably an easier task than we expected it to be. With the help of Atlassian Plugin SDK, developers can spend more time worrying about the plugin logic than on the troublesome deployment activities. And yes, after all, it is the plugin logic that is going to make an impact!

This chapter details how the various components fit into JIRA's architecture and how JIRA exposes the various pluggable points. We will also see an overview of the JIRA's system plugins to find out how JIRA uses the plugin architecture to its own benefit, followed by some useful recipes!

JIRA Architecture

We will quickly see how the various components within JIRA fit in to form the JIRA we know. It is best described in a diagram and Atlassian has a neat one along with a detailed explanation at http://confluence.atlassian.com/display/JIRA/JIRA+Architectural+Overview. We will re-draw the diagram a little bit to explain it in a brief but...

Converting plugins from v1 to v2


If you are moving to JIRA 4.x from JIRA 3.13.x or earlier versions, one of the important differences is the introduction of v2 plugins. While designing the upgrade to JIRA 4.x, it makes perfect sense to sometimes migrate the plugins from v1 to v2, although it is not a mandatory step. In this recipe, we will see how to convert a version1 plugin to a version2 plugin.

Getting ready

There are a couple of questions we need to ask before the plugin is converted:

  • Are all the packages used by the plugin available to OSGi plugins ? This is very important because JIRA doesn't expose all the packages to OSGi plugins.

    The list of packages exported and made available to the plugins2 version can be found in the com.atlassian.jira.plugin.DefaultPackageScannerConfiguration class.

  • Are all the components used by the plugin available to OSGi plugins? Similar to the previous question, we need to make sure the components are also exposed to the OSGi plugins.

    Unfortunately, there is...

Adding resources into plugins


It is often required to add static resources like JavaScript files, CSS files, and so on in our plugins. To enable JIRA to serve these additional static files, they should be defined as downloadable resources.

Getting ready

A resource can be of different types. It is normally defined as a non-Java file that the plugin requires to operate.

Examples of resources that you will come across during JIRA plugin development include, but are not restricted to, the following:

  • Velocity (*.vm) files required to render a view

  • JavaScript files

  • CSS files

  • Property files for localization

How to do it...

To include a resource, add the resource module to the atlassian-plugin.xml file. The resource module can be added as part of the entire plugin or can be included within another module, restricting it just for that module.

The following are the attributes and elements available for the resource module and their uses:

Name

Description

name

Name of the resource. This is used by the plugin...

Adding web resources into plugins


The web resources plugin module, like the resource module we just saw, allows defining downloadable resources. The difference is that the web resources are added at the top of the page in the header with the cache-related headers set to never expire.

An additional advantage of using web resources module is that we can specify the resources to be included in specific contexts within the application.

How to do it...

The root element for the web resource plugin module is web-resource. It supports the following attributes:

Name

Description

Key

The only mandatory attribute. This should be unique within the plugin.

Disabled

Indicates whether the plugin module should be disabled by default or not.

i18n-name-key

The localization key for the human-readable name of the plugin module.

Name

Human-readable name of the web resource.

The following are the key elements supported.

Name

Description

description

Description of the module.

resource

All the resources...

Building JIRA from source


One of the best things about JIRA, if you have a valid license, is that you get to see the source code. To see it, modify it, break it... err modify it because you have the license to do it!

Getting ready

Following are some of the pre-requisites prior to building JIRA from the source.

  • A valid JIRA license to get access to the source code.

  • An environment with JDK 1.5 or higher for JIRA 4.2 and lower versions. JDK 1.6 or higher for JIRA 4.3+.

  • You will need both Maven1 and Maven2 if you are building versions prior to JIRA 4.3. Download Maven version 1.0.x and 2.1.x from http://maven.apache.org. JIRA 4.3+ needs only Maven 2.1.0.

Note

You need both Maven1 and Maven2 for versions prior to JIRA 4.3 because Maven1 is required to build the JIRA source and Maven2 is required to build plugins for JIRA. JIRA has bundled plugins thatneed to be built along with JIRA and so Maven2 is also a must.

Maven 2.1.0+ is required for the plugin development process.

How to do it...

Let us see the...

Adding new webwork actions to JIRA


Most of the time plugin developers will find themselves writing new actions in JIRA to introduce new functionality. Usually these actions are invoked from new web-item links configured at different places in the UI. It could also be from customized JSPs or other parts of the JIRA framework.

New actions can be added to JIRA with the help of the webwork plugin module.

Getting ready

Before we start, it probably makes sense to have a look at the webwork plugin module. Following are the key attributes supported:

Name

Description

Key

A unique key within the plugin. It will be used as the identifier for the plugin.

Class

This will be java.lang.Object as the real logic will reside in the action, Class.

i18n-name-key

The localization key for the human-readable name of the plugin module.

Name

Human-readable name of the webwork action.

The following are the key elements supported:

Name

Description

description

Description of the webwork module.

actions

...

Extending a webwork action in JIRA


There are so many user stories for this one! How do you override some of the JIRA built-in actions? How do you do some additional stuff in the JIRA built-in action? (Like doing some crazy things immediately after creation before the page returns to the user, or doing some innovative validations on some of those actions)

Extending the existing JIRA action is an answer to all these questions. Let us see in detail how to do that.

How to do it...

Extending a JIRA action is done with the help of the webwork plugin module. Most of it is very similar to writing new webwork actions.

Let us take the case of the create issue action. What should we do if we need to extend the create action? Say, to do some additional validation and to do some extra things after the actual creation is done?

The following are the steps, in a nutshell:

  1. Identify the action to be overridden by looking up the actions.xml under WEB-INF/classes in your JIRA installation directory.

    In our case, CreateIssueDetails...

Left arrow icon Right arrow icon

Key benefits

  • Extend and Customize JIRA--Work with custom fields, workflows, Reports & Gadgets, JQL functions, plugins, and more
  • Customize the look and feel of your JIRA User Interface by adding new tabs, web items and sections, drop down menus, and more
  • Master JQL - JIRA Query Language that enables advanced searching capabilities through which users can search for issues in their JIRA instance and then exploit all the capabilities of issue navigator
  • Part of Packt's Cookbook series: Each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible

Description

JIRA provides issue tracking and project tracking for software development teams to improve code quality and the speed of development.This book is your one-stop resource to master JIRA extension and customization. You will learn how to create your own JIRA plugins, customize the look and feel of your JIRA UI, work with Workflows, Issues, Custom Fields, and much more.The book starts with recipes on simplifying the Plugin development process followed by a complete chapter dedicated to the Plugin Framework to master Plugins in JIRA.Then we will move on to writing custom field plugins to create new field types or custom searchers. We then learn how to program and customize Workflows to transform JIRA into a user-friendly system. Reporting support in an application like JIRA is inevitable! With so much data spanning across different projects, issues, etc and a lot of project planning done on it, we will cover how to work on reports and gadgets to get customized data according to our needs. We will then look at customizing the various searching aspects of JIRA such as JQL, searching in plugins, managing filters, and so on. Then the book steers towards programming Issues, i.e. creating/editing/deleting issues, creating new issue operations, managing the various other operations available on issues via the JIRA APIs etc. In the latter half of the book, you will learn how to customize JIRA by adding new tabs, menus, and web items, communicate with JIRA via the REST, SOAP or XML/RPC interfaces, and work with the JIRA database.The book ends with a chapter on useful and general JIRA recipes.

Who is this book for?

If you are a JIRA developer or project manager who wants to fully exploit the exciting capabilities of JIRA, then this is the perfect book for you.

What you will learn

  • Create and deploy your own JIRA plugins
  • Deal with Custom Fields on an Issue and program Custom Field Options
  • Program and customize Workflows to transform JIRA into a user-friendly system
  • Create reports that show statistics for particular people, projects, versions, or other fields within issues
  • Simplify reporting by writing your own JIRA Gadgets, which can be added into a user s dashboard
  • Create, edit, and delete Issues
  • Master Database handling in JIRA --retrieve Issue information from Database, extend the database, retrieve Custom Field details from the database, access database entities from plugins, and more
  • Communicate with JIRA via the REST, SOAP or XML/RPC interfaces
Estimated delivery fee Deliver to New Zealand

Standard delivery 10 - 13 business days

NZ$20.95

Premium delivery 5 - 8 business days

NZ$74.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Nov 24, 2011
Length: 476 pages
Edition : 1st
Language : English
ISBN-13 : 9781849681803
Vendor :
Atlassian
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to New Zealand

Standard delivery 10 - 13 business days

NZ$20.95

Premium delivery 5 - 8 business days

NZ$74.95
(Includes tracking information)

Product Details

Publication date : Nov 24, 2011
Length: 476 pages
Edition : 1st
Language : English
ISBN-13 : 9781849681803
Vendor :
Atlassian
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just NZ$7 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just NZ$7 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total NZ$ 281.97
JIRA 6.x Administration Cookbook
NZ$80.99
JIRA Development Cookbook
NZ$96.99
JIRA 5.2 Essentials
NZ$103.99
Total NZ$ 281.97 Stars icon

Table of Contents

11 Chapters
Plugin Development Process Chevron down icon Chevron up icon
Understanding Plugin Framework Chevron down icon Chevron up icon
Working with Custom Fields Chevron down icon Chevron up icon
Programming Workflows Chevron down icon Chevron up icon
Gadgets and Reporting in JIRA Chevron down icon Chevron up icon
The Power of JIRA Searching Chevron down icon Chevron up icon
Programming Issues Chevron down icon Chevron up icon
Customizing the UI Chevron down icon Chevron up icon
Remote Access to JIRA Chevron down icon Chevron up icon
Dealing with a Database Chevron down icon Chevron up icon
Useful Recipes Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.7
(7 Ratings)
5 star 71.4%
4 star 28.6%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Amazon Customer Jan 22, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book shows the power of JIRA, the best plugin book yet by far from one of the best plugin developers and his company are leaders in JIRA Plugins.Also interesting to see the power of JIRA and why it is taking over the industry! Look out, these products are industry changers and the prices for the products and services have set the status quo up side down!One thing I would like to see, it seems Jobin and his company are using a new style of plugin development, basically a cloud based integration for entire systems instead of traditional point to point solutions they call the product ConnectAll. This book came out before their new ConnectAll plugin. I wish it had covered this approach!
Amazon Verified review Amazon
LB Jun 13, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I saw this book displayed on one of the vendor stations at the recent Atlassian Summit. After perusing the table of contents, it looked like something that I needed to bring back to my company. Two days after the book arrived there were two V.P.'s and a Director 'fighting' over it and they've already generated query results that have resulted in some process changes and planning decisions. I have ordered 3 additional copies.
Amazon Verified review Amazon
EMC Feb 02, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
An excellent book about JIRA plugin development written for programmers by a programmer. The book is extensive, well organized, homogeneous and very effective. The author guides you through the subject from the initial setup of the development environment, describing the most important JIRA APIs to extend and customize the JIRA behavior, including advanced topics such as JQL customization and the extension of the JIRA database schema. The book also covers in detail the customization process of the JIRA user interface and the integration of JIRA with third party systems using web services (SOAP, RESTful and JAX-RPC). A must-have for a JIRA plugin developer.If you're interested about a more in-depth review of this book, I wrote a post about it in my blog (<...>).
Amazon Verified review Amazon
Modha Jan 05, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
JIRA Development Cookbook is a good book to start learning JIRA plugin development. Content is very well organized and simple to understand examples. Chapters are self contained and cover every aspect of JIRA plugin development and are not presented in overtly technical manner. If you are a plugin guru this book is not for you, but if you are newbie it is worth your money.
Amazon Verified review Amazon
Akila Ramanathan Jan 16, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
If you want to develop Jira as a business system that can almost do anything, get this book to know the nuts and bolts of Jira development.All the chapters were self sufficient and if you are a Jira Admin - this book is for you.-Srini
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the digital copy I get with my Print order? Chevron down icon Chevron up icon

When you buy any Print edition of our Books, you can redeem (for free) the eBook edition of the Print Book you’ve purchased. This gives you instant access to your book when you make an order via PDF, EPUB or our online Reader experience.

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela