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

Book Description

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

  • 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

  • In Detail

    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.

    Table of Contents

    1. JIRA Development Cookbook
      1. JIRA Development Cookbook
      2. Credits
      3. About the Author
      4. Acknowledgment
      5. About the Reviewers
      6. 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
      7. 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
        7. Downloading the example code for this book
          1. Errata
          2. Piracy
          3. Questions
      8. 1. Plugin Development Process
        1. Introduction
          1. What is a JIRA plugin?
            1. The plugin development process
              1. Atlassian plugin exchange
              2. Troubleshooting
        2. Setting up the development environment
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Proxy settings for Maven
            2. Using local Maven
            3. Configuring IDEs to use SDK
            4. Troubleshooting
          5. 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. Deploying a 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. Reusing the configurations in each run
            3. Troubleshooting
        5. Making changes and re-deploying a plugin
          1. How to do it...
          2. Debugging in Eclipse
          3. See also
        6. 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 version of JIRA/Tomcat
          5. See also
      9. 2. Understanding Plugin Framework
        1. Introduction
          1. JIRA Architecture
            1. Third-party components
              1. Webwork
              2. Seraph
              3. OSUser
              4. PropertySet
              5. OSWorkflow
              6. OfBiz Entity Engine
              7. Apache Lucene
            2. Atlassian Gadget JavaScript Framework
              1. 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
          4. What goes into atlassian-plugin.xml?
          5. Working with the Plugins1 and Plugins2 versions
            1. Development
            2. Installation
          6. JIRA System plugins
        2. Converting plugins from v1 to v2
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Adding resources into plugins
          1. Getting ready
          2. How to do it...
        4. 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 batchmode
            3. See also
        5. 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
        6. 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
        7. Extending a webwork action in JIRA
          1. How to do it...
          2. How it works...
          3. See also
      10. 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...
          4. See also
        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 from 4.1.x
          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
      11. 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 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...
          3. See also
        10. Obtaining available workflow actions programmatically
          1. How to do it...
            1. How it works...
            2. There's more...
              1. Getting the Action IDs, given 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. Re-ordering 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. Jelly escalation
          1. Getting ready
          2. How to do it...
          3. How it works...
      12. 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 Excel format
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. 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
      13. 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 a JQL query in plugins
          1. How to do it...
            1. How it works...
            2. 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
      14. 7. Programming Issues
        1. Introduction
        2. Creating an issue from a plugin
          1. How to do it...
            1. How it works...
            2. There's more...
              1. Using IssueManager to create the issue
        3. Creating subtasks on an issue
          1. How to do it...
          2. See also
        4. Updating an issue
          1. How to do it...
          2. Deleting an issue
            1. How to do it...
            2. Adding new issue operations
              1. Getting ready
              2. How to do it...
              3. How it works...
              4. There's more...
              5. See also
            3. Conditions on issue operations
              1. Getting ready...
              2. How to do it...
              3. How it works...
            4. 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...
            5. 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 remaining estimate
                  2. Deleting a worklog and retaining the remaining estimate
                  3. Deleting a worklog with a new remaining estimate
            6. 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
                  1. Deleting comments
              2. Programming Change Logs
                1. How to do it...
                2. How it works...
              3. Programming issue links
                1. Getting Ready...
                2. How to do it...
                3. There's more...
                  1. Deleting Issue Links
                    1. Retrieving Issue Links on an issue
                4. Validations on issue linking
                  1. Getting Ready...
                  2. How to do it...
                  3. How it works...
                  4. See also
                5. Discarding fields while cloning
                  1. Getting ready...
                  2. How to do it...
                  3. How it works...
                  4. See also
                6. JavaScript tricks on issue fields
                  1. How to do it...
                  2. How it works...
      15. 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. Adding conditions for web fragments
          1. How to do it...
          2. How it works...
        6. Creating new velocity context for web fragments
          1. How to do it...
          2. How it works...
        7. Adding a new drop-down menu on the top navigation bar
          1. How to do it...
          2. How it works...
        8. Dynamic creation of web items
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Adding new tabs in the View Issue screen
          1. Getting ready
          2. How to do it...
          3. How it works...
        10. Adding new tabs in the Browse Project screen
          1. Getting ready
          2. How to do it...
          3. How it works...
        11. Creating Project Tab Panel using fragments
          1. How to do it...
          2. How it works...
        12. Adding new tabs in the Browse Version screen
          1. Getting ready
          2. How to do it...
          3. How it works...
        13. Adding new tabs in the Browse Component screen
          1. Getting ready
          2. How to do it...
          3. How it works...
        14. Extending a webwork action to add UI elements
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        15. Displaying dynamic notifications/warnings on issues
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        16. Re-ordering Issue Operations in the View Issue page
          1. How to do it...
          2. How it works...
          3. See also
        17. Re-ordering fields in the View Issue page
          1. How to do it...
      16. 9. Remote Access to JIRA
        1. Introduction
        2. Creating a SOAP client
          1. Getting ready
          2. How to do it...
        3. Creating an issue via SOAP
          1. Getting ready
          2. How to do it...
            1. How it works...
        4. Working with custom fields and SOAP
          1. Getting ready
          2. How to do it...
            1. Creating an issue with custom field values
              1. Updating custom fields on an issue
              2. Browsing custom fields on an issue
          3. Attachments and SOAP
            1. Getting ready
            2. How to do it...
          4. Worklogs and time tracking via SOAP
            1. Getting ready...
            2. How to do it...
            3. How it works...
            4. There's more...
          5. Commenting on an issue via SOAP
            1. Getting ready
            2. How to do it...
          6. User and group management via SOAP
            1. Getting ready
            2. How to do it...
          7. Progressing an issue in workflow using SOAP
            1. Getting ready
            2. How to do it...
            3. Managing versions via SOAP
              1. Getting ready
              2. How to do it...
            4. Administration methods in SOAP API
              1. Getting ready
              2. How to do it...
              3. How it works...
            5. Deploy a SOAP service in JIRA
              1. Getting ready
              2. How to do it...
              3. How it works...
            6. Deploy a XML-RPC service within JIRA
              1. Getting ready
              2. How to do it...
              3. How it works...
              4. See also
            7. Writing a Java XML-RPC client
              1. Getting ready
              2. How to do it...
            8. Expose services and data entities as REST APIs
              1. Getting ready
              2. How to do it...
              3. How it works...
            9. Writing Java client for REST API
              1. Getting ready
              2. How to do it...
      17. 10. Dealing with a Database
        1. Introduction
        2. Extending JIRA DB with custom schema
          1. How to do it...
          2. How it works...
        3. Accessing DB entities from plugins
          1. How to do it...
          2. Reading from a database
            1. Writing a new record
            2. Updating a record
        4. Persisting plugin information in JIRA DB
          1. How to do it...
            1. How it works...
        5. Using active objects to store data
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Accessing JIRA configuration properties
          1. How to do it...
          2. Getting database connection for JDBC calls
            1. How to do it...
          3. Migrating a custom field from one type to another
            1. How to do it...
          4. Retrieving issue information from a Database
            1. How to do it...
            2. There's more...
          5. Retrieving custom field details from a database
            1. How to do it...
          6. Retrieving permissions on issues from a database
            1. How to do it...
          7. Retrieving workflow details from a database
            1. How to do it...
          8. Updating issue status in a database
            1. Getting ready
            2. How to do it...
          9. Retrieving users and groups from a database
            1. How to do it...
          10. Dealing with Change history in a database
            1. How to do it...
      18. 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…
            1. How it works...
            2. See also
        4. Writing scheduled tasks in JIRA
          1. How to do it...
          2. How it works...
        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 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 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...
            1. Enabling Access logs prior to JIRA 4.x
          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 JIRA code
            2. Overriding by extending PicoContainer
        18. Creating issues and comments from e-mail
          1. How to do it...
          2. How it works...
        19. Internationalization in webwork plugins
          1. How to do it...
          2. Sharing common libraries across v2 plugins
            1. Getting ready
            2. How to do it...
          3. Operations using direct HTML links
            1. How to do it...