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 View Workflows page
  2. Click on the Add Workflow button
  3. Enter a name and description for the new workflow in the Add Workflow dialog
  4. Click on the Add button to create the workflow

The newly created workflow will only contain the default create and open statuses, 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 option, so you do not have to manually create multiple transitions for the status.
If the global status is not representing a Done or Closed status, it is often a good idea to add a Clear Resolution post function to make sure the resolution field is always cleared when issue is transitioned into the 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 reuse existing statuses if possible so that 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 that issues can move from one status to the next. There are two ways to create a transition:

  • Click on the Add transition button
  • Select the originating status and 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: This is the originating status. The transition will be available when the issue is in the selected status.
  • To status: This is the destination status. Once the transition is executed, the issue will be put into the selected status.
  • Name: This is the name of the transition. This is the text that will be displayed to users. Since transitions are actions performed by users, it is usually a good idea to name your transitions starting with a verb, such as Close Issue.
  • Description: This is an optional text description showing the purpose of this transition. This will not be displayed to users.
  • Screen: This is 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 click on the Reuse a transition tab, From status and To status, and Transition to reuse, as shown in the following screenshot:

Note that 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 the 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, by allowing closed issues to be reopened. This will prevent users from accidentally closing an issue and not being able to correct the mistake.

One thing people often overlook is that you can change the status an issue is transitioned to when it is first created. By default, an issue is placed in the open status as soon as it is created. While this makes sense for most cases, you can actually change that. For example, you might want all your issues to be in a waiting status and transition to open only after someone has reviewed it. You can also make changes to the default Create Issue transition. By doing so, you can influence the issue creation process. For example, you can add a validator to it to add additional checking before an issue is allowed to be created, or add a post function to perform additional tasks as soon as an issue is created.

Now that we have seen how to add new statuses and transitions to a workflow, let's look at adding triggers, 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
3.22.27.45