O'Reilly logo

Practical JIRA Plugins by Matthew B. Doar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Workflow Customizations

Overview

This chapter covers how to create JIRA plugins for use with workflows. Conditions, validators and post-functions are each described in detail, with both nonconfigurable and configurable examples. All the source code for the examples in this chapter is available from https://marketplace.atlassian.com/41293. The standard JIRA conditions, validators, and post-functions plugins are also useful examples and can be found in the file system-workflow-plugin.xml.

Conditions

Conditions control whether a transition appears in a user’s list of available workflow actions. For instance, the default JIRA workflow only shows the Start Progress transition to the current assignee of an issue. Other users don’t see the transition as a choice in their view of the issue’s actions.

Conditions are configured with the Add link on the Conditions tab of a workflow transition, as described at http://confluence.atlassian.com/display/JIRA/Configuring+Workflow#ConfiguringWorkflow-Addingacondition. You can also combine multiple conditions using AND and OR operations, but not negation.

Creating a custom condition is relatively straightforward, at least compared with custom fields and searchers. The first example is of a condition that has no configuration.

First we add a workflow-condition element to atlassian-plugin.xml as shown in Example 5-1.

Example 5-1. atlassian-plugin.xml for a condition with no configuration
<workflow-condition key="custom-noconfig-condition" name="A ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required