JIRA Development Cookbook
()
About this ebook
Read more from Jobin Kuruvilla
JIRA Development Cookbook - Third Edition Rating: 0 out of 5 stars0 ratingsJIRA 5.x Development Cookbook Rating: 0 out of 5 stars0 ratings
Related to JIRA Development Cookbook
Related ebooks
JIRA 7 Administration Cookbook - Second Edition Rating: 0 out of 5 stars0 ratingsElasticSearch Cookbook Rating: 5 out of 5 stars5/5SoapUI Cookbook Rating: 0 out of 5 stars0 ratingsMicrosoft Azure Development Cookbook Second Edition Rating: 5 out of 5 stars5/5SQL Server Analysis Services 2012 Cube Development Cookbook Rating: 0 out of 5 stars0 ratingsGit Version Control Cookbook Rating: 4 out of 5 stars4/5Redmine Cookbook Rating: 0 out of 5 stars0 ratingsMastering JIRA 7 - Second Edition Rating: 0 out of 5 stars0 ratingsUML Complete Self-Assessment Guide Rating: 0 out of 5 stars0 ratingsData vault modeling Complete Self-Assessment Guide Rating: 0 out of 5 stars0 ratingsData Hubs A Complete Guide - 2021 Edition Rating: 0 out of 5 stars0 ratingsObject Oriented Programming Inheritance: Fundamentals and Applications Rating: 0 out of 5 stars0 ratingsDesign Patterns A Complete Guide - 2020 Edition Rating: 0 out of 5 stars0 ratingsHigh Performance Computing: Technology, Methods and Applications Rating: 0 out of 5 stars0 ratingsSchematron: A language for validating XML Rating: 0 out of 5 stars0 ratingsJIRA 7 Essentials - Fourth Edition Rating: 5 out of 5 stars5/5Google Apigee Third Edition Rating: 0 out of 5 stars0 ratingsDevOps Practices Complete Self-Assessment Guide Rating: 0 out of 5 stars0 ratings.NET Mastery: The .NET Interview Questions and Answers Rating: 0 out of 5 stars0 ratingsLeveraging WMI Scripting: Using Windows Management Instrumentation to Solve Windows Management Problems Rating: 5 out of 5 stars5/5Machine Learning: Hands-On for Developers and Technical Professionals Rating: 0 out of 5 stars0 ratingsRobust Cloud Integration with Azure Rating: 0 out of 5 stars0 ratingsWeb Services: Theory and Practice Rating: 0 out of 5 stars0 ratingsISO IEC 11179 A Complete Guide Rating: 0 out of 5 stars0 ratingsProfessional ASP.NET MVC 5 Rating: 0 out of 5 stars0 ratingsMicrosoft Azure A Complete Guide - 2019 Edition Rating: 1 out of 5 stars1/5IBM WebSphere Application Server 8.0 Administration Guide Rating: 0 out of 5 stars0 ratingsProfessional PHP Design Patterns Rating: 5 out of 5 stars5/5Enterprise Integration Patterns A Complete Guide - 2020 Edition Rating: 0 out of 5 stars0 ratings
Information Technology For You
Computer Science: A Concise Introduction Rating: 4 out of 5 stars4/5How to Write Effective Emails at Work Rating: 4 out of 5 stars4/5Inkscape Beginner’s Guide Rating: 5 out of 5 stars5/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5Health Informatics: Practical Guide Rating: 0 out of 5 stars0 ratingsHow To Use Chatgpt: Using Chatgpt To Make Money Online Has Never Been This Simple Rating: 0 out of 5 stars0 ratingsData Governance For Dummies Rating: 0 out of 5 stars0 ratingsData Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5ChatGPT: The Future of Intelligent Conversation Rating: 4 out of 5 stars4/5AWS Certified Cloud Practitioner: Study Guide with Practice Questions and Labs Rating: 5 out of 5 stars5/5Linux Command Line and Shell Scripting Bible Rating: 3 out of 5 stars3/5Micro Niches Rating: 0 out of 5 stars0 ratingsCODING INTERVIEW: Advanced Methods to Learn and Excel in Coding Interview Rating: 0 out of 5 stars0 ratingsAn Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5CompTIA ITF+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam FC0-U61 Rating: 0 out of 5 stars0 ratingsComputer Organization and Design: The Hardware / Software Interface Rating: 4 out of 5 stars4/5Hacking Essentials - The Beginner's Guide To Ethical Hacking And Penetration Testing Rating: 3 out of 5 stars3/5Windows Registry Forensics: Advanced Digital Forensic Analysis of the Windows Registry Rating: 4 out of 5 stars4/5Cybersecurity for Beginners : Learn the Fundamentals of Cybersecurity in an Easy, Step-by-Step Guide: 1 Rating: 0 out of 5 stars0 ratingsProgramming for Everyone Rating: 3 out of 5 stars3/5Raspberry Pi :Raspberry Pi Guide On Python & Projects Programming In Easy Steps Rating: 3 out of 5 stars3/5CompTIA A+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Core 1 Exam 220-1101 Rating: 0 out of 5 stars0 ratingsHandbook of Digital Forensics and Investigation Rating: 4 out of 5 stars4/5Guide to Healthcare Information Protection and Privacy for Executives Rating: 0 out of 5 stars0 ratingsSupercommunicator: Explaining the Complicated So Anyone Can Understand Rating: 3 out of 5 stars3/5COMPUTER SCIENCE FOR ROOKIES Rating: 0 out of 5 stars0 ratingsThe Basics of Hacking and Penetration Testing: Ethical Hacking and Penetration Testing Made Easy Rating: 4 out of 5 stars4/5
Reviews for JIRA Development Cookbook
0 ratings0 reviews
Book preview
JIRA Development Cookbook - Jobin Kuruvilla
Table of Contents
JIRA Development Cookbook
Credits
About the Author
Acknowledgment
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Instant Updates on New Packt Books
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code for this book
Errata
Piracy
Questions
1. Plugin Development Process
Introduction
What is a JIRA plugin?
The plugin development process
Atlassian plugin exchange
Troubleshooting
Setting up the development environment
Getting ready
How to do it...
How it works...
There's more...
Proxy settings for Maven
Using local Maven
Configuring IDEs to use SDK
Troubleshooting
See also
Creating a skeleton plugin
Getting ready
How to do it...
How it works...
There's more...
One step to your skeleton plugin
Creating an Eclipse project
See also
Deploying a plugin
Getting ready
How to do it...
How it works...
There's more...
Using a specific version of JIRA
Reusing the configurations in each run
Troubleshooting
Making changes and re-deploying a plugin
How to do it...
Debugging in Eclipse
See also
Testing and debugging
Getting ready
How to do it...
How it works...
There's more...
Using custom data for Integration/Functional Tests
Testing against different version of JIRA/Tomcat
See also
2. Understanding Plugin Framework
Introduction
JIRA Architecture
Third-party components
Webwork
Seraph
OSUser
PropertySet
OSWorkflow
OfBiz Entity Engine
Apache Lucene
Atlassian Gadget JavaScript Framework
Quartz
Architecture explained…
Authentication and user management
Property management
Presentation
Database
Workflows
Searching
Scheduled jobs
Plugins
Types of plugin modules
Reporting
Workflows
Custom fields
Searching
Links and tabs
Remote invocation
Actions and components
Other plugin modules
What goes into atlassian-plugin.xml?
Working with the Plugins1 and Plugins2 versions
Development
Installation
JIRA System plugins
Converting plugins from v1 to v2
Getting ready
How to do it...
How it works...
See also
Adding resources into plugins
Getting ready
How to do it...
Adding web resources into plugins
How to do it...
How it works...
There's more...
Web resource contexts
Turning off batchmode
See also
Building JIRA from source
Getting ready
How to do it...
How it works...
There's more...
Building JIRA dependencies
See also
Adding new webwork actions to JIRA
Getting ready
How to do it...
How it works...
There's more...
Adding new commands to the action
See also
Extending a webwork action in JIRA
How to do it...
How it works...
See also
3. Working with Custom Fields
Introduction
Writing a simple custom field
Getting ready
How to do it...
How it works...
There's more...
See also
Custom field searchers
Getting ready
How to do it...
How it works...
There's more...
Dealing with custom fields on an issue
Getting ready
How to do it...
How it works...
See also
Programming custom field options
Getting ready
How to do it...
See also
Overriding validation of custom fields
Getting ready
How to do it...
See also
Customizing the change log value
Getting ready
How to do it...
How it works...
Migrating from one custom field type to another
How to do it...
How it works...
There's more...
Changing the type of a custom field
See also
Making custom fields sortable
Getting ready
How to do it...
How it works...
There's more...
See also
Displaying custom fields on subtask columns
How to do it...
How it works...
User and date fields from 4.1.x
How to do it...
How it works...
See also
Adding custom fields to notification mails
Getting ready
How to do it...
How it works...
Adding help text for a custom field
Getting ready
How to do it...
How it works...
Removing the 'none' option from a select field
How to do it...
There's more...
Reloading velocity changes without restart (auto reloading)
See also
Making the custom field project importable
How to do it...
See also
Changing the size of a text area custom field
How to do it...
See also
4. Programming Workflows
Introduction
Writing a workflow condition
Getting ready
How to do it...
How it works...
See also
Writing a workflow validator
Getting ready
How to do it...
How it works...
See also
Writing a workflow post function
Getting ready
How to do it...
How it works...
See also
Editing an active workflow
How to do it...
How it works...
There's more...
Modifying workflows in JIRA database
Making an issue editable/non-editable based on workflow status
How to do it...
How it works...
See also
Including/excluding resolutions for specific transitions
How to do it...
How it works...
Permissions based on workflow status
How to do it...
How it works...
See also
Internationalization in workflow transitions
How to do it...
How it works...
See also
Obtaining available workflow actions programmatically
How to do it...
How it works...
There's more...
Getting the Action IDs, given name
Programmatically progressing on workflows
How to do it...
How it works...
Obtaining workflow history from the database
Getting ready
How to do it...
How it works...
See also
Re-ordering workflow actions in JIRA
How to do it...
How it works...
Creating common transitions in workflows
How to do it...
How i works...
Jelly escalation
Getting ready
How to do it...
How it works...
5. Gadgets and Reporting in JIRA
Introduction
Writing a JIRA report
Getting ready
How to do it...
How it works...
See also
Reports in Excel format
Getting ready
How to do it...
How it works...
There's more...
See also
Data validation in JIRA reports
Getting ready
How to do it...
How it works...
See also
Restricting access to reports
Getting ready
How to do it...
How it works...
See also
Object configurable parameters for reports
How to do it...
How it works...
See also
Creating a pie chart in JIRA
Getting ready…
How to do it...
How it works...
There's more...
See also
Writing JIRA 4 gadgets
Getting ready
How to do it...
How it works...
There's more...
Invoking REST services from gadgets
Getting ready
How to do it...
How it works...
See also
Configuring user preferences in gadgets
Getting ready...
How to do it...
How it works...
There's more...
See also
Accessing gadgets outside of JIRA
How to do it...
How it works...
See also
6. The Power of JIRA Searching
Introduction
Writing a JQL function
Getting ready
How to do it...
How it works...
See also
Sanitizing JQL functions
Getting ready
How to do it...
How it works...
See also
Adding a search request view
Getting ready
How to do it...
How it works...
See also
Smart querying using quick search
How to do it...
There's more...
Searching in plugins
How to do it...
There's more...
See also
Parsing a JQL query in plugins
How to do it...
How it works...
See also
Linking directly to search queries
How to do it...
How it works...
There's more...
Index and de-index programmatically
How to do it...
See also
Managing filters programmatically
How to do it...
See also
Subscribing to a filter
How to do it...
How it works...
There's more...
See also
7. Programming Issues
Introduction
Creating an issue from a plugin
How to do it...
How it works...
There's more...
Using IssueManager to create the issue
Creating subtasks on an issue
How to do it...
See also
Updating an issue
How to do it...
Deleting an issue
How to do it...
Adding new issue operations
Getting ready
How to do it...
How it works...
There's more...
See also
Conditions on issue operations
Getting ready...
How to do it...
How it works...
Working with attachments
Getting ready...
How to do it...
Creating an attachment
Reading attachments on an issue
Deleting an attachment
There's more...
Time tracking and worklog management
Getting ready...
How to do it...
Auto adjusting the remaining estimate
Logging work and retaining the remaining estimate
Logging work with a new remaining estimate
Logging work and adjusting the remaining estimate by a value
How it works...
There's more
Updating worklogs
Deleting worklogs
Auto Adjusting remaining estimate
Deleting a worklog and retaining the remaining estimate
Deleting a worklog with a new remaining estimate
Working with comments on issues
How to do it...
Creating comments on issues
Creating comments on an issue and restricting it to a project role or group
Updating comments
Deleting comments
Programming Change Logs
How to do it...
How it works...
Programming issue links
Getting Ready...
How to do it...
There's more...
Deleting Issue Links
Retrieving Issue Links on an issue
Validations on issue linking
Getting Ready...
How to do it...
How it works...
See also
Discarding fields while cloning
Getting ready...
How to do it...
How it works...
See also
JavaScript tricks on issue fields
How to do it...
How it works...
8. Customizing the UI
Introduction
Changing the basic look and feel
How to do it...
Adding new web sections in the UI
How to do it...
How it works...
See also
Adding new web items in the UI
How to do it...
How it works...
See also
Adding conditions for web fragments
How to do it...
How it works...
Creating new velocity context for web fragments
How to do it...
How it works...
Adding a new drop-down menu on the top navigation bar
How to do it...
How it works...
Dynamic creation of web items
Getting ready
How to do it...
How it works...
Adding new tabs in the View Issue screen
Getting ready
How to do it...
How it works...
Adding new tabs in the Browse Project screen
Getting ready
How to do it...
How it works...
Creating Project Tab Panel using fragments
How to do it...
How it works...
Adding new tabs in the Browse Version screen
Getting ready
How to do it...
How it works...
Adding new tabs in the Browse Component screen
Getting ready
How to do it...
How it works...
Extending a webwork action to add UI elements
Getting ready
How to do it...
How it works...
See also
Displaying dynamic notifications/warnings on issues
Getting ready
How to do it...
How it works...
See also
Re-ordering Issue Operations in the View Issue page
How to do it...
How it works...
See also
Re-ordering fields in the View Issue page
How to do it...
9. Remote Access to JIRA
Introduction
Creating a SOAP client
Getting ready
How to do it...
Creating an issue via SOAP
Getting ready
How to do it...
How it works...
Working with custom fields and SOAP
Getting ready
How to do it...
Creating an issue with custom field values
Updating custom fields on an issue
Browsing custom fields on an issue
Attachments and SOAP
Getting ready
How to do it...
Worklogs and time tracking via SOAP
Getting ready...
How to do it...
How it works...
There's more...
Commenting on an issue via SOAP
Getting ready
How to do it...
User and group management via SOAP
Getting ready
How to do it...
Progressing an issue in workflow using SOAP
Getting ready
How to do it...
Managing versions via SOAP
Getting ready
How to do it...
Administration methods in SOAP API
Getting ready
How to do it...
How it works...
Deploy a SOAP service in JIRA
Getting ready
How to do it...
How it works...
Deploy a XML-RPC service within JIRA
Getting ready
How to do it...
How it works...
See also
Writing a Java XML-RPC client
Getting ready
How to do it...
Expose services and data entities as REST APIs
Getting ready
How to do it...
How it works...
Writing Java client for REST API
Getting ready
How to do it...
10. Dealing with a Database
Introduction
Extending JIRA DB with custom schema
How to do it...
How it works...
Accessing DB entities from plugins
How to do it...
Reading from a database
Writing a new record
Updating a record
Persisting plugin information in JIRA DB
How to do it...
How it works...
Using active objects to store data
Getting ready
How to do it...
How it works...
Accessing JIRA configuration properties
How to do it...
Getting database connection for JDBC calls
How to do it...
Migrating a custom field from one type to another
How to do it...
Retrieving issue information from a Database
How to do it...
There's more...
Retrieving custom field details from a database
How to do it...
Retrieving permissions on issues from a database
How to do it...
Retrieving workflow details from a database
How to do it...
Updating issue status in a database
Getting ready
How to do it...
Retrieving users and groups from a database
How to do it...
Dealing with Change history in a database
How to do it...
11. Useful Recipes
Introduction
Writing a service in JIRA
Getting ready
How to do it...
See also
Adding configurable parameters to a service
How to do it…
How it works...
See also
Writing scheduled tasks in JIRA
How to do it...
How it works...
Writing listeners in JIRA
Getting ready
How to do it...
How it works...
There's more...
Handling, enabling, and disabling of plugins
Customizing e-mail content
How to do it...
How it works...
There's more...
Advanced Customization—adding custom field information
Redirecting to different page in webwork actions
How to do it...
Adding custom behavior for user details
Getting ready
How to do it...
How it works...
Deploying a servlet in JIRA
Getting ready
How to do it...
How it works...
Adding shared parameters to Servlet Context
Getting ready
How to do it...
How it works...
Writing a Servlet Context Listener
Getting ready
How to do it...
How it works...
Using filters to intercept queries in JIRA
Getting ready
How to do it...
How it works...
Adding and importing components in JIRA
Getting ready
How to do it...
Exposing components to other plugins
Importing public components
Using service properties in components
How it works...
Adding new module types to JIRA
Getting ready
How to do it...
Creating modules using the new module type
Using the new modules created
How it works...
Enabling access logs in JIRA
How to do it...
Enabling Access logs prior to JIRA 4.x
How it works...
Enabling SQL logging in JIRA
How to do it...
How it works...
Overriding JIRA's default components in plugins
Getting ready
How to do it...
How it works...
There's more...
Overriding by modifying JIRA code
Overriding by extending PicoContainer
Creating issues and comments from e-mail
How to do it...
How it works...
Internationalization in webwork plugins
How to do it...
Sharing common libraries across v2 plugins
Getting ready
How to do it...
Operations using direct HTML links
How to do it...
Index
JIRA Development Cookbook
JIRA Development Cookbook
Copyright © 2011 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: November 2011
Production Reference: 1161111
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-84968-180-3
www.packtpub.com
Cover Image by Sandeep Babu (<sandyjb@gmail.com>)
Credits
Author
Jobin Kuruvilla
Reviewers
Fidel Castro Armario
Justin Koke
Dawid Kowalski
Sergey Markovich
Marcin Zręda
Acquisition Editor
Amey Kanse
Development Editor
Alina Lewis
Technical Editors
Sakina Kaydawala
Mohd. Sahil
Copy Editors
Leonard D'Silva
Brandt D'Mello
Laxmi Subramanian
Project Coordinator
Leena Purkait
Proofreader
Lesley Harrison
Indexer
Tejal Daruwale
Graphics
Valentina D'Silva
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat
About the Author
Jobin Kuruvilla is an Atlassian Consultant who is experienced in customizing JIRA and writing JIRA plugins for various customers. He is working with Go2group, a premier Atlassian partner and is involved in managing Atlassian products for big enterprises to small starter license installations.
Jobin had started his career as a Java/J2EE Developer in one of the biggest IT companies in India. After spending the initial years in the SOA world, he got hooked into this amazing product called JIRA, which he came across during the evaluation of third-party products for a requirements management solution. Soon Jobin realized the power of JIRA and pledged to spread the word. He has been doing it ever since, and reckons there is a long way to go!
Jobin runs a website named J Tricks – Little JIRA Tricks
(http://www.j-tricks.com). He has written numerous tutorials to help the developer community, who he thinks has contributed immensely to his personal development. It is indeed those tutorials that sowed the first seeds for this book.
Acknowledgment
No book is the product of just the author – he just happens to be the one with his name on the cover.
A number of people contributed to the success of this book, and it would take more space than I have to thank each one individually.
First of all, thanks to the Almighty God for helping me to sail through the difficulties in this short life and for making my life as wonderful as it is now.
The next biggest thanks go to my Acquisition editor, Amey Kanse, who patiently explained to me every single doubt I threw at him and made me feel at home through the entire process of writing this book. Thank you, Amey, for believing in me and for being a wonderful guide through this process. Special thanks should go to Mary Nadar, who recognized the author in me, Leena Purkait, the Project coordinator for this book, and Alina Lewis, the Development editor of the book. Also thanks to the entire Packt Publishing team for working so diligently to help bring out a high quality product.
It is amazing to work with a team of talented developers and technical geeks. I am fortunate to work with such teams throughout my career, and it just makes you fall in love with the work. In particular, thanks are due to each and every member of the 'STORM team', 'PD&B team', and 'RAMP team'. Your encouragement and support were invaluable to me – you guys rock!
I must also thank the talented JIRA community who are instrumental in helping each other, sharing solutions, being active on the forums, running user groups, and what not. I am just one of the many who benefited.
Before I wind up, thank you, Atlassian, for giving us JIRA and a set of other wonderful products. You don't realize how much easier you are making our lives!
Last, but not least, a big thank you to the Go2group for the reception that you have given, the support extended in writing this book, and for believing in my capabilities.
About the Reviewers
Fidel Castro Armario has been working for Spanish Public Administration (Junta de Andalucía) since 2000 as a Consultant and Software Engineer. During his career, he specialized in business process design, implementation and optimization, and software QA. Since 2008, he is focused on designing and implementing a whole system of processes based on JIRA for IT departments management, IT services outsourcing, and CRM implementation.
He has a passion for designing highly detailed and accurate workflows, with self-explanatory interfaces, which are teamwork-oriented and aimed for work efficiency. He employs for his work a self-developed methodology, enabling implementation of high complexity processes, keeping maintenance and administration cost at low levels.
JIRA Workflow Toolbox plugin is a comprehensive workflow extension developed by Fidel as support for his work and is available at the Atlassian Plugin Exchange site.
My deepest gratitude goes to so many people who have trusted me and supported my efforts. Without them, I couldn't have carried out any of my projects on JIRA.
I would like to dedicate my work to my wife, Carmen, and my son, Felipe, for their support and understanding for the many hours I devoted to review this book.
Dawid Kowalski is a third year student at Poznań University of Technology in Poland. He is currently employed at Wolters Kluwer as a Software Developer and works on JIRA-related projects. He is ambitious, hard-working, and organized. He is active in the scientific club and works there on optimization problems. He is also the captain of the Imagine Cup 2010 and 2011 semi-finalist team.
I would like to thank my closest friends and family for continuous support and encouragement.
Sergey Markovich is currently a co-founder of Plugenta Labs, a company focusing on the development of add-ons to enterprise software and an independent Atlassian JIRA and Confluence contractor.
In the past, a code wizard in several multinational corporations and startups and a Bachelor in Computer Science.
I want to thank my mom and dad for giving me birth and growing me up the way you did it. Everything I have in my life I it owe to you.
I also want to say warm words to everybody involved with Plugenta Labs. It's a real pleasure to work with you and I keep learning from you every day.
Marcin Zręda specializes in Business Analysis and Quality Assurance. He has many years of experience as a programmer and designer. He is the author of many articles on JIRA and the owner of the http://www.testandtry.com blog. He has implemented JIRA for many departments for more than 600 employees. He is currently directing the department of business analysis for a large international company.
www.PacktPub.com
Support files, eBooks, discount offers and more
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
Why Subscribe?
Fully searchable across every book published by Packt
Copy and paste, print and bookmark content
On demand and accessible via web browser
Free Access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
Instant Updates on New Packt Books
Get notified! Find out when new books are published by following @PacktEnterprise on Twitter, or the Packt Enterprise Facebook page.
This book is dedicated to
My wife Anumol, the joy of my heart, my best friend for years who even chose to give up her career for the company of this mortal. Anu, I wouldn't be in this place if not for your unconditional love and care.
My sweet little daughter Anna, the light of my world. I am sure you will read this one day and understand what I was doing all night scratching my head in front of the laptop instead of changing your nappies!
My parents, Alice and Kuruvilla, who brought me up in a village not many people have heard of. Nothing beats the pain and suffering they have undergone in the process
My sister, Juby Sara, the best sister in the world. It is a privilege watching you follow my footsteps outshining me all the way!
My friends from TKM and JNV Kottayam who dared me to dream and then helped me to achieve them. You guys are the best.
This book would not have been possible without your love and understanding.
A big thank you from the bottom of my heart. I have nothing to give back, but my love and prayers.
Preface
This book is your one-stop resource for mastering 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.
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; that is, creating/editing/deleting issues, creating new issue operations, managing the other various operations available on issues using the JIRA APIs, and so on.
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 using 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.
What this book covers
Chapter 1, Plugin Development Process, covers the fundamentals of JIRA plugin development process. It covers, in detail, the setting up of a development environment, creating a plugin, deploying it, and testing it.
Chapter 2, Understanding Plugin Framework, covers, in detail, the JIRA architecture and looks at the various plugin points. It also looks at how to build JIRA from source and extend or override the existing JIRA functionalities.
Chapter 3, Working with Custom Fields, looks at programmatically creating custom fields in JIRA, writing custom field searchers, and various other useful recipes related to custom fields.
Chapter 4, Programming Workflows, looks at the various ways of programming the JIRA workflows. It includes writing new conditions, validators, post functions, and so on, and contains related recipes that are useful in extending the workflows.
Chapter 5, Gadgets and Reporting in JIRA, covers the reporting capabilities of JIRA. It looks at writing reports, dashboard gadgets, among others in detail.
Chapter 6, The Power of JIRA Searching, covers the searching capabilities of JIRA and how it can be extended using the JIRA APIs.
Chapter 7, Programming Issues, looks at the various APIs and methods used for managing issues programmatically. It covers the CRUD operations, working with attachments, programming change logs and issue links, time tracking, among others.
Chapter 8, Customizing the UI, looks at the various ways of extending and modifying the JIRA user interface.
Chapter 9, Remote Access to JIRA, looks at the remote capabilities of JIRA – REST, SOAP, and XML/RPC, and the ways of extending them.
Chapter 10, Dealing with the Database, looks at the database architecture of JIRA and covers the major tables in detail. It also covers the different ways to extend the storage and access or modify the data from plugins.
Chapter 11, Useful Recipes, covers a selected list of useful recipes which do not belong in the preceding categories, but are powerful enough to get your attention! Read away!!
What you need for this book
This book focuses on JIRA development. You will need the following software as a bare minimum:
JIRA 4.x+
JAVA 1.6+
Maven 2.x
Atlassian Plugin SDK
An IDE of your choice. The examples in the book use Eclipse and SQL Developer.
Some of the recipes are too simple to use the fully-fledged plugin development process, and you will see this highlighted as you read through the book!
Who this book is 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.
Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: The fields oldvalue and newvalue are populated using the method getChangelogValue.
A block of code is set as follows:
changeitem
package-
name=>
numeric
/>
groupid
type=numeric
/>
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
changeitem
package-
name=>
extremely-long
/>
Any command line input or output is written as follows:
maven war:webapp
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: You must have noticed the new View Issue page.
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <feedback@packtpub.com>, and mention the book title via the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Downloading the example code for this book
You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <copyright@packtpub.com> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
Questions
You can contact us at <questions@packtpub.com> if you are having a problem with any aspect of the book, and we will do our best to address it.
Chapter 1. Plugin Development Process
In this chapter, we will cover:
Setting up the development environment
Creating a Skeleton plugin
Deploying a JIRA plugin
Testing and debugging
Introduction
Atlassian JIRA, as we all know, is primarily an Issue Tracking and Project Tracking System. What many people do not know, though, is the power of its numerous customization capabilities, using which we can turn it into a different system altogether! Maybe a helpdesk system, a user story management system, an online approval process, and a lot more. This is in addition to the issue tracking and project tracking capabilities for which JIRA, arguably, is the best player in the market.
So what are these customizations? How can we convert the JIRA we know into a product we want? Or maybe just add extra functionalities that are specific to our organization?
The answer to these questions probably can be summarized in a single word—plugins. JIRA has given the power to its users to write plugins and customize the functionality in a way they find suitable.
But is that the only way? Definitely not! JIRA itself provides a lot of customization options through its user interface, and in more demanding cases, using property files like jira-application.properties. In some cases, you will also find yourself modifying some of the JIRA core files to tweak functionality or to work around a problem. We will see more of that in the chapters to come but the best entry point to JIRA customizations are plugins. And that is where we start our cookbook, before we move on to the in-depth details.
What is a JIRA plugin?
So, what is a JIRA plugin? JIRA itself is a web application written in Java. But that doesn't mean you need to know JAVA to write a plugin, though in most cases you will need to. You might end up writing a simple descriptor file to add few links here and there. If that makes the non-Java developer in you happy, watch out for the different plugin modules JIRA supports.
A JIRA plugin is a JAR file that has a mandatory plugin descriptor and some optional Java classes and velocity templates. The velocity templates are used to render the HTML pages associated with your plugin, but in some cases, you might also want to introduce JSPs to make use of some pre-existing templates in JIRA. JSPs, as opposed to velocity templates, cannot be embedded in the plugin, but instead they should be dropped into the appropriate folders in the JIRA web application.
The plugin descriptor, the only mandatory part of a plugin, is an XML file