Authoring a workflow

So, let's take a look at how to create and set up a new workflow in Jira. To create a new workflow, all you need is a name and description:

  1. Browse to the Jira administration console.
  2. Select the Issues tab and then the Workflows option.
  3. Click on the Add Workflow button.
  4. Enter a name and description for the new workflow in the Add Workflow dialog.
  5. Click on the Add button to create the workflow.

The newly created workflow will only contain the default create and open status, so you will need to configure it by adding new statuses and transitions to make it useful. Let's start with adding new statuses to the workflow using the following steps:

  1. Click on the Add status button.
  2. Select an existing status from the drop-down list. If the status you need does not exist, you can create a new status by entering its name and pressing the Enter key on your keyboard.
  3. Check the Allow all statuses to transition to this one option, if you want users to be able to move the issue into this status regardless of its current status. This will create a Global Transition, which is a convenient way to allow an issue to use this transition from any status to get to the target status.

 

  1. Click on the Add button to add the status to your workflow. You can repeat these steps to add as many statuses as you want to your workflow:
Try to re-use existing statuses if possible, so you do not end up with many similar statuses to manage.

Now that the statuses are added to the workflow, they need to be linked with transitions, so issues can move from one status to the next. There are two ways to create a transition:

  • Click on the Add transition button or you can follow the next step
  • Select the originating status, then click and drag the arrow to the destination status

Both options will bring up the Add transition dialog, as shown in the following screenshot:

From the preceding screenshot, you can choose to either create a new transition with the New Transition tab or use an existing transition with the Reuse a transition tab.

When creating a new transition, you will need to configure the following:

  • From status: The originating status. The transition will be available when the issue is in the selected status.
  • To status: The destination status. Once the transition is executed, the issue will be put into the selected status.
  • Name: Name of the transition. This is the text that will be displayed to users. It is usually a good idea to name your transitions starting with a verb, such as Close Issue or Submit for Review.
  • Description: An optional text description is the purpose of this transition. This will not be displayed to users.
  • Screen: An optional intermediate screen to be displayed when users execute the transition. For example, you display a screen to capture additional data as part of the transition. If you do not select a screen, the transition will be executed immediately. The following screenshot shows a workflow screen:

If you want to reuse an existing transition, simply select the Reuse a transition tab, the From status and To status, and the transition to reuse, as shown in the following screenshot:

Jira will only list valid transitions based on the To status selection.

You might be wondering when you should create a new transition and when you should reuse an existing transition. The big difference between the two is that when you reuse a transition, all instances of the reused transition, also known as common transition, will share the same set of configurations, such as conditions and validators. Also, any changes made to the transition will be applied to all instances. A good use case for this is when you need to have multiple transitions with the same name and setup, such as Close Issue; instead of creating separate transitions each time, you can create one transition and reuse it whenever you need a transition to close an issue. Later on, if you need to add a new validator to the transition to validate additional user input, you will only need to make the change once, rather than multiple times for each Close Issue transition.

Another good practice to keep in mind is to not have a dead end state in your workflow, for example, allowing closed issues to be reopened. This will prevent users from accidentally closing an issue and not being able to correct the mistake.

Now that we have seen how to add new statuses and transitions to a workflow, let's look at adding conditions, validators, and post functions to a transition.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset