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
$35.98 $39.99
Paperback
$65.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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

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 a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

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 $5 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 $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 191.97
JIRA 6.x Administration Cookbook
$54.99
JIRA Development Cookbook
$65.99
JIRA 5.2 Essentials
$70.99
Total $ 191.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 included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.