JIRA Development T J h I Cookbook i R r d A E Third Edition D d it e i o v n e JIRA provides issue and project tracking for software l o development teams to improve code quality and the speed What you will learn from this book p of development. With the new version of JIRA, you can m create your own JIRA plugins and customize the look and feel of your JIRA UI easier than ever. Create and deploy your own JIRA plugins e n JIRA Development Cookbook, Third Edition, is a one-stop t Manipulate workfl ows to transform JIRA resource to master extensions and customizations in JIRA. into a user-friendly system C This book starts with recipes about simplifying the plugin o development process followed by recipes dedicated to the o Create custom reports that show statistics plugin framework. Then, you will move on to writing custom k for particular people, projects, versions, fi eld plugins to create new fi eld types or custom searchers. b or other fi elds within issues You will also learn how to program and customize o workfl ows to transform JIRA into a user-friendly system. o With so much data spanning different projects, issues, and Simplify reporting by writing your own k Q u i c k a n s w e r s t o c o m m o n p r o b l e m s JIRA gadgets, which can be added into so on, we will cover how to work on reports and gadgets to a user's dashboard get customized data according to our needs. At the end of the book, you will learn how to customize JIRA by adding JIRA Development new tabs, menus, and web items; communicate with JIRA Master database handling by extending via the REST APIs; and work with the JIRA database. and retrieving custom fi eld details from the database Who this book is written for Cookbook If you are a JIRA developer or administrator, or a project Deal with custom fi elds on an issue and program custom fi eld options manager who wants to fully exploit the exciting capabilities J of JIRA, then this is the perfect book for you. o Third Edition b i n $ 59.99 US K £ 40.99 UK u r u Your one-stop resource for mastering extensions v il and customizations in JIRA 7+ l a professional expertise distilled Prices do not include local sales tax or VAT PP UU BB LL II SS HH II NN GG where applicable Visit www.PacktPub.com for books, eBooks, Jobin Kuruvilla code, downloads, and PacktLib. professional expertise distilled PP UU BB LL II SS HH II NN GG JIRA Development Cookbook Third Edition Your one-stop resource for mastering extensions and customizations in JIRA 7+ Jobin Kuruvilla BIRMINGHAM - MUMBAI JIRA Development Cookbook Third Edition Copyright © 2016 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: September 2016 Production reference: 1230916 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78588-561-7 www.packtpub.com Credits Author Copy Editor Jobin Kuruvilla Safis Editing Reviewer Project Coordinator Satyendra Gangadhar Narwane Devanshi Doshi Commissioning Editor Proofreader Kunal Parikh Safis Editing Acquisition Editor Indexer Chaitanya Nair Rekha Nair Content Development Editor Graphics Samantha Gonsalves Jason Monteiro Technical Editor Production Coordinator Anushree Arun Tendulkar Aparna Bhagat About the Author Jobin Kuruvilla is an Atlassian Consultant with experience in customizing JIRA and writing JIRA plugins for various customers. He is currently working with Go2Group as an Atlassian platinum expert, and is involved in managing Atlassian products for big enterprises as well as small starter license installations. From an IT nerd to a DevOps evangelist, Jobin has performed various roles in his professional journey so far. Jobin is the author of JIRA Development Cookbook, released in 2011, and JIRA 5.x Development Cookbook, released in 2013, both published by Packt Publishing and well-received in the JIRA community. He also runs a website named J-Tricks (http://www.j-tricks.com), using which he shares numerous tutorials to help the developer community, who he believes have contributed immensely to his personal development. It is indeed those tutorials that sowed the first seeds of JIRA Development Cookbook. Jobin started his career as a Java/J2EE developer in one of the biggest IT companies in India. After spending his initial years in the SOA world, he got hooked into this amazing product called JIRA, which he came across during the evaluation of a number of third-party tools. Soon, Jobin realized the power of JIRA, and pledged to spread the word. He has been doing it ever since, and he reckons there is a long way to go! Outside the office, Jobin enjoys sports, especially soccer, and is on the verge of getting addicted to movies and social networking sites. Acknowledgments 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 goes to the Content Development Editor, Samantha Gonsalves, and Acquisition Editor, Prachi Bisht, both of whom went through the pain of making me write another book. Also, a big shout-out to Anushree Tendulkar, the Technical Editor, who worked tirelessly to make the book as readable as it is now. And to the entire Packt Publishing team for working so diligently to help bring out another high quality product. It is amazing to work with talented developers and technical geeks. Thank you to all the intelligent minds, with whom I got a chance to share this amazing journey of programming. Your encouragement and support were/are invaluable to me; you guys rock! I must also thank the talented Atlassian community who are instrumental in helping each other, sharing solutions, being active in the forums, running user groups, and whatnot. I am just one of the many who have 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 you are making our lives easier. Go Team! Last, but not the least, a big thanks to all at Go2group for the support extended in writing this book and believing in my capabilities. We will, together, continue to simplify complexities for our numerous customers. About the Reviewer Satyendra Gangadhar Narwane describes himself as someone who is honest, caring, intelligent, hardworking, and ambitious. He has a great sense of humor. He is a post- graduate with masters in computer science from one of the premier Indian university and working as a Sr. Atlassian product expert in Dynamic Network Factory (U.S.A.), he has conducted seminar on behalf of Atlassian for promoting their tools in India, He has developed dozens of custom add-on based on customer needs. He has providing training, administrating & add-on development on Atlassian suite for top companies such as Oracle, Adobe, HCL,Mercedes Benz, MillenniumIT, Filpkart, ShipNet NS, KBC Bank. He is passionate about technology, computers science, traveling, watching movies and enjoy great chats. He has also worked on Jira 7 Development Cookbook. I would like to express my gratitude to the many people who help me through this book. I would like to thank Packt for giving me a chance to work on this book. Above all I want to thank my mom Sushila, wife Poonam and the rest of my family, who supported and encouraged me in spite of all the time it took me away from them. It was a long and difficult journey for them. I would like to thank Suzanne Coutinho, Chaitanya Nair for helping me in the process of selection and reviewing. Last and not least: I beg forgiveness of all those who have been with me over the course of the years and whose names I have failed to mention." www.PacktPub.com For support files and downloads related to your book, please visit www.PacktPub.com. 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 [email protected] for more details. 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. https://www2.packtpub.com/books/subscription/packtlib Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read 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 a web browser My parents, Alice and Kuruvilla, who found something in me that I never knew existed. Nothing beats the pain and suffering they have undergone in the process. "Behind every young child who believes in himself is a parent who believed first." - Matthew Jacobson My wife Anumol, my best friend for years. I wouldn't be in this place if not for her unconditional love and care. "Happy is the man who finds a true friend, and far happier is he who finds that true friend in his wife." - Franz Schubert My little princesses, Elsa & Anna. Err, I mean ANNA & SARAH! "Happiness is getting a hug from your daughter for no reason " - Anonymous My sister, Juby Sara, the best sister in the world. And to her husband, Davis, & son, Kuttoos, for keeping her happy. You both are doing a much better job than me ;) "What’s the good of news if you haven’t a sister to share it?" - Jenny DeVries My friends from TKM and JNV Kottayam who dared me to dream and then helped me to achieve them. You guys are the best. "A friend in need...". Enough said! 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. Table of Contents Preface 1 Chapter 1: Plugin Development Process 8 Introduction 8 What is a JIRA add-on? 9 The plugin development process 10 Atlassian Marketplace 11 Troubleshooting 11 Setting up the development environment 11 Getting ready 12 How to do it… 12 There's more… 13 Proxy settings for Maven 13 Using local Maven 14 Configuring IDEs to use the SDK 14 Troubleshooting 15 Creating a skeleton plugin 15 Getting ready 15 How to do it… 15 How it works… 16 There's more… 18 One step to your skeleton plugin 18 Creating an Eclipse project 18 Adding plugin modules 19 Getting ready 19 How to do it… 19 How it works… 20 Deploying a JIRA plugin 22 Getting ready 22 How to do it… 23 How it works… 24 There's more… 25 Using a specific version of JIRA 25 Reusing the data in each run 26 Troubleshooting 26 Making changes and redeploying a plugin 26 How to do it… 27