You are previewing JIRA 5.x Development Cookbook.
O'Reilly logo
JIRA 5.x Development Cookbook

Book Description

This book is your one stop resource for mastering JIRA extensions and customizations

  • 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 the issue navigator

  • In Detail

    JIRA provides issue tracking and project tracking for software development teams to improve code quality and the speed of development.

    "JIRA 5.x Development Cookbook" is a one stop resource to master extensions and customizations in JIRA. 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.

    "JIRA 5.x Development Cookbook" 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, and so on, and a lot of planning done for the project, 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.

    "JIRA 5.x Development Cookbook" steers towards programming issues, such as creating, editing, and deleting issues, creating new issue operations, managing the various other operations available on issues via the JIRA APIs, and so on.

    In the latter half of "JIRA 5.x Development Cookbook", 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.

    Table of Contents

    1. JIRA 5.x Development Cookbook
      1. Table of Contents
      2. JIRA 5.x Development Cookbook
      3. Credits
      4. About the Author
      5. Acknowledgement
      6. About the Reviewers
      7. www.PacktPub.com
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
          3. Instant Updates on New Packt Books
      8. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      9. 1. Plugin Development Process
        1. Introduction
          1. What is a JIRA plugin?
            1. The plugin development process
              1. Atlassian Marketplace
              2. Troubleshooting
        2. Setting up the development environment
          1. Getting ready
          2. How to do it…
          3. There's more…
            1. Proxy settings for Maven
            2. Using local Maven
            3. Configuring IDEs to use the SDK
            4. Troubleshooting
          4. See also
        3. Creating a skeleton plugin
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. One step to your skeleton plugin
            2. Creating an Eclipse project
          5. See also
        4. Adding plugin modules
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        5. Deploying a JIRA plugin
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Using a specific version of JIRA
            2. Re-using the configurations in each run
            3. Troubleshooting
        6. Making changes to and redeploying a plugin
          1. How to do it…
          2. There's more…
            1. Debugging in Eclipse
          3. See also
        7. Using FastDev for plugin development
          1. Getting ready
          2. How to do it…
          3. How it works...
          4. There's more…
            1. Adding ignored files
            2. Changing admin credentials
          5. See also
        8. Testing and debugging
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
            1. Using custom data for integration/functional tests
            2. Testing against different versions of JIRA/Tomcat
          5. See also
      10. 2. Understanding the Plugin Framework
        1. Introduction
          1. JIRA architecture
            1. Third-party components
              1. Webwork
              2. Seraph
              3. OSUser
              4. Embedded Crowd
              5. PropertySet
              6. Active Objects
              7. OSWorkflow
              8. OFBiz Entity Engine
              9. Apache Lucene
              10. Atlassian Gadget JavaScript Framework
              11. Quartz
        2. Architecture explained
          1. Authentication and user management
          2. Property management
          3. Presentation
          4. Database
          5. Workflows
          6. Searching
          7. Scheduled jobs
          8. Plugins
        3. Types of plugin modules
          1. Reporting
          2. Workflows
          3. Custom fields
          4. Searching
          5. Links and tabs
          6. Remote invocation
          7. Actions and components
          8. Other plugin modules
          9. What goes into atlassian-plugin.xml?
        4. Working with the Plugins1 and Plugins2 versions
        5. JIRA system plugins
        6. Stable and core APIs
        7. Modifying Atlassian bundled plugins
          1. How to do it…
          2. How it works…
          3. See also
        8. Converting plugins from v1 to v2
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        9. Adding resources into plugins
          1. Getting ready
          2. How to do it…
        10. Adding web resources into plugins
          1. How to do it…
          2. How it works…
          3. There's more...
            1. Web resource contexts
            2. Turning off batch mode
          4. See also
        11. Building JIRA from source
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Building JIRA dependencies
          5. See also
        12. Adding new webwork actions to JIRA
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Adding new commands to the action
          5. See also
        13. Extending a webwork action in JIRA
          1. How to do it…
          2. How it works…
          3. See also
        14. Capturing plugin installation/uninstallation events
          1. How to do it…
          2. How it works…
          3. See also
      11. 3. Working with Custom Fields
        1. Introduction
        2. Writing a simple custom field
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
          5. See also
        3. Custom field searchers
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        4. Dealing with custom fields on an issue
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Programming custom field options
          1. Getting ready
          2. How to do it…
          3. See also
        6. Overriding validation of custom fields
          1. Getting ready
          2. How to do it…
          3. See also
        7. Customizing the change log value
          1. Getting ready
          2. How to do it…
          3. How it works…
        8. Migrating from one custom field type to another
          1. How to do it…
          2. How it works…
          3. There's more…
            1. Changing the type of a custom field
          4. See also
        9. Making custom fields sortable
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        10. Displaying custom fields on subtask columns
          1. How to do it…
          2. How it works…
        11. User and date fields
          1. How to do it…
          2. How it works…
          3. See also
        12. Adding custom fields to notification mails
          1. Getting ready
          2. How to do it…
          3. How it works…
        13. Adding help text for a custom field
          1. Getting ready
          2. How to do it...
          3. How it works…
        14. Removing the "none" option from a select field
          1. How to do it…
          2. There's more…
            1. Reloading Velocity changes without restart (auto-reloading)
          3. See also
        15. Making the custom field project importable
          1. How to do it…
          2. See also
        16. Changing the size of a text area custom field
          1. How to do it…
          2. See also
      12. 4. Programming Workflows
        1. Introduction
        2. Writing a workflow condition
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        3. Writing a workflow validator
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        4. Writing a workflow post function
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. See also
        5. Editing an active workflow
          1. How to do it…
          2. How it works…
          3. There's more…
            1. Modifying workflows in the JIRA database
        6. Making an issue editable/non-editable based on workflow status
          1. How to do it…
          2. How it works…
          3. See also
        7. Including/excluding resolutions for specific transitions
          1. How to do it…
          2. How it works…
        8. Permissions based on workflow status
          1. How to do it…
          2. How it works…
          3. See also
        9. Internationalization in workflow transitions
          1. How to do it…
          2. How it works…
        10. Obtaining available workflow actions programmatically
          1. How to do it…
          2. How it works…
          3. There's more...
            1. Getting the action IDs, given the name
        11. Programmatically progressing on workflows
          1. How to do it...
          2. How it works…
        12. Obtaining workflow history from the database
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. See also
        13. Reordering workflow actions in JIRA
          1. How to do it...
          2. How it works…
        14. Creating common transitions in workflows
          1. How to do it…
          2. How it works…
        15. Creating global transitions in workflows
          1. How to do it…
          2. How it works…
        16. Jelly escalation
          1. Getting ready
          2. How to do it…
          3. How it works…
      13. 5. Gadgets and Reporting in JIRA
        1. Introduction
        2. Writing a JIRA report
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Reports in an Excel format
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Data validation in JIRA reports
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        5. Restricting access to reports
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Object-configurable parameters for reports
          1. How to do it...
          2. How it works...
          3. See also
        7. Creating a pie chart in JIRA
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        8. Writing JIRA 4 gadgets
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        9. Invoking REST services from gadgets
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        10. Configuring user preferences in gadgets
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        11. Accessing gadgets outside of JIRA
          1. How to do it...
          2. How it works...
          3. See also
      14. 6. The Power of JIRA Searching
        1. Introduction
        2. Writing a JQL function
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        3. Sanitizing JQL functions
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        4. Adding a search request view
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        5. Smart querying using quick search
          1. How to do it…
          2. There's more…
        6. Searching in plugins
          1. How to do it…
          2. There's more…
          3. See also
        7. Parsing JQL queries in plugins
          1. How to do it…
          2. How it works…
          3. See also
        8. Linking directly to search queries
          1. How to do it…
          2. How it works…
          3. There's more…
        9. Index and de-index programmatically
          1. How to do it…
          2. See also
        10. Managing filters programmatically
          1. How to do it...
          2. See also
        11. Subscribing to a filter
          1. How to do it…
          2. How it works…
          3. There's more…
          4. See also
      15. 7. Programming Issues
        1. Introduction
        2. Creating an issue from a plugin
          1. How to do it...
          2. How it works...
          3. There's more...
            1. Using IssueManager to create the issue
          4. See also
        3. Creating subtasks on an issue
          1. How to do it...
          2. See also
        4. Updating an issue
          1. How to do it...
        5. Deleting an issue
          1. How to do it...
        6. Adding new issue operations
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        7. Conditions on issue operations
          1. Getting ready...
          2. How to do it...
          3. How it works...
        8. Working with attachments
          1. Getting ready
          2. How to do it...
            1. Creating an attachment
            2. Reading attachments on an issue
            3. Deleting an attachment
          3. There's more...
        9. Time tracking and worklog management
          1. Getting ready...
          2. How to do it...
            1. Auto adjusting the remaining estimate
            2. Logging work and retaining the remaining estimate
            3. Logging work with a new remaining estimate
            4. Logging work and adjusting the remaining estimate by a value
          3. How it works...
          4. There's more
            1. Updating worklogs
            2. Deleting worklogs
              1. Auto adjusting the remaining estimate
              2. Deleting a worklog and retaining the remaining estimate
              3. Deleting a worklog with a new remaining estimate
              4. Deleting a worklog and adjusting the remaining estimate
        10. Working with comments on issues
          1. How to do it...
            1. Creating comments on issues
            2. Creating comments on an issue and restricting it to a project role or group
            3. Updating comments
            4. Deleting comments
        11. Programming change logs
          1. How to do it...
          2. How it works...
        12. Programming issue links
          1. Getting Ready
          2. How to do it...
          3. There's more...
            1. Deleting issue links
            2. Retrieving issue links on an issue
        13. Discarding fields while cloning
          1. Getting ready...
          2. How to do it...
          3. How it works...
          4. See also
        14. JavaScript tricks on issue fields
          1. How to do it...
          2. How it works...
        15. Creating issues and comments from an e-mail
          1. How to do it...
          2. How it works...
      16. 8. Customizing the UI
        1. Introduction
        2. Changing the basic look and feel
          1. How to do it...
        3. Adding new web sections in the UI
          1. How to do it...
          2. How it works...
          3. See also
        4. Adding new web items in the UI
          1. How to do it...
          2. How it works...
          3. See also
        5. Use of decorators
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Adding conditions for web fragments
          1. How to do it...
          2. How it works...
        7. Creating new Velocity context for web fragments
          1. How to do it...
          2. How it works...
        8. Adding a new drop-down menu on the top navigation bar
          1. How to do it...
          2. How it works...
        9. Dynamic creation of web items
          1. Getting ready
          2. How to do it...
          3. How it works...
        10. Adding new tabs in the View Issue screen
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
            1. Loading issue tab panel asynchronously
        11. Adding new tabs in the Browse Project screen
          1. Getting ready
          2. How to do it...
          3. How it works...
        12. Creating the project tab panel using fragments
          1. How to do it...
          2. How it works...
        13. Adding new tabs in the Browse Version screen
          1. Getting ready
          2. How to do it...
          3. How it works...
        14. Adding new tabs in the Browse Component screen
          1. Getting ready
          2. How to do it...
          3. How it works...
        15. Adding issue link renderers
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        16. Extending a webwork action to add UI elements
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        17. Displaying dynamic notifications/warnings on issues
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        18. Re-ordering issue operations in the View Issue page
          1. How to do it...
          2. How it works...
          3. See also
        19. Re-ordering fields in the View Issue page
          1. How to do it...
          2. There's more…
            1. Wrapping custom fields in a separate module
          3. See also
      17. 9. Remote Access to JIRA
        1. Introduction
        2. Writing a Java client for the REST API
          1. Getting ready
          2. How to do it...
        3. Creating a SOAP client
          1. Getting ready
          2. How to do it...
        4. Writing a Java XML-RPC client
          1. Getting ready
          2. How to do it...
        5. Working with issues
          1. Getting ready
          2. How to do it...
        6. Working with attachments
          1. Getting ready
          2. How to do it...
            1. Using the input stream and a new filename
            2. Using AttachmentInput
            3. Using file and a new filename
            4. Browsing attachments
        7. Remote time tracking
          1. Getting ready...
          2. How to do it...
        8. Working with comments
          1. Getting ready
          2. How to do it...
        9. Remote user and group management
          1. Getting ready
          2. How to do it...
        10. Progressing an issue in a workflow
          1. Getting ready
          2. How to do it...
        11. Managing versions
          1. Getting ready
          2. How to do it...
        12. Managing components
          1. Getting ready
          2. How to do it...
        13. Remote administration methods
          1. Getting ready
          2. How to do it...
          3. How it works...
        14. Exposing services and data entities as REST APIs
          1. Getting ready
          2. How to do it...
          3. How it works...
        15. Deploying a SOAP service in JIRA
          1. Getting ready
          2. How to do it...
          3. How it works...
        16. Deploying an XML-RPC service within JIRA
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
      18. 10. Dealing with the JIRA Database
        1. Introduction
        2. Extending the JIRA database with a custom schema
          1. How to do it...
          2. How it works...
        3. Accessing database entities from plugins
          1. How to do it...
            1. Reading from a database
            2. Writing a new record
            3. Updating a record
        4. Persisting plugin information in the JIRA database
          1. How to do it...
          2. How it works...
        5. Using Active Objects to store data
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Accessing the JIRA configuration properties
          1. How to do it...
        7. Getting a database connection for JDBC calls
          1. How to do it...
        8. Migrating a custom field from one type to another
          1. How to do it...
        9. Retrieving issue information from a database
          1. How to do it...
          2. There's more...
        10. Retrieving custom field details from a database
          1. How to do it...
        11. Retrieving permissions on issues from a database
          1. How to do it...
        12. Retrieving workflow details from a database
          1. How to do it...
        13. Updating the issue status in a database
          1. Getting ready
          2. How to do it...
        14. Retrieving users and groups from a database
          1. How to do it...
        15. Dealing with change history in a database
          1. How to do it...
      19. 11. Useful Recipes
        1. Introduction
        2. Writing a service in JIRA
          1. Getting ready
          2. How to do it...
          3. See also
        3. Adding configurable parameters to a service
          1. How to do it…
          2. How it works...
          3. See also
        4. Writing scheduled tasks in JIRA
          1. How to do it...
          2. How it works...
          3. There's more...
        5. Writing listeners in JIRA
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Handling, enabling, and disabling of plugins
        6. Customizing e-mail content
          1. How to do it...
          2. How it works...
          3. There's more...
            1. Advanced customization—adding custom field information
        7. Redirecting to a different page in webwork actions
          1. How to do it...
        8. Adding custom behavior for user details
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Deploying a servlet in JIRA
          1. Getting ready
          2. How to do it...
          3. How it works...
        10. Adding shared parameters to the servlet context
          1. Getting ready
          2. How to do it...
          3. How it works...
        11. Writing a servlet context listener
          1. Getting ready
          2. How to do it...
          3. How it works...
        12. Using filters to intercept queries in JIRA
          1. Getting ready
          2. How to do it...
          3. How it works...
        13. Adding and importing components in JIRA
          1. Getting ready
          2. How to do it...
            1. Exposing components to other plugins
            2. Importing public components
            3. Using service properties in components
          3. How it works...
        14. Adding new module types to JIRA
          1. Getting ready
          2. How to do it...
            1. Creating modules using the new module type
            2. Using the new modules created
          3. How it works...
        15. Enabling access logs in JIRA
          1. How to do it...
          2. How it works...
        16. Enabling SQL logging in JIRA
          1. How to do it...
          2. How it works...
        17. Overriding JIRA's default components in plugins
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Overriding by modifying the JIRA code
        18. Internationalization in webwork plugins
          1. How to do it...
        19. Sharing common libraries across v2 plugins
          1. Getting ready
          2. How to do it...
        20. Operations using direct HTML links
          1. How to do it...
      20. Index