Advanced workflow configuration

This page describes advanced configurations for transitions in Jira workflows. For information about the basics of workflows – see Working with workflow.

You can find other advanced workflow topics here:

As a Jira administrator, you can control the following aspects of a workflow transition.

  • Triggers – transition Jira issues when certain events occur in a connected development tool, such as Bitbucket.
  • Conditions – check that a transition should be performed by the user.
  • Validators – check that any input to the transition (for example, by a user) is valid, before the transition is performed.
  • Post functions – carry out additional processing, after a transition is performed.
  • Properties – are key-value pairs that can be used to further customize transitions.

Triggers

Jira administrators can configure triggers in Jira workflows that respond to events in your linked development tools. This allows you to set up your development tools and Jira workflows so that, for example, when a developer creates a branch to start work on an issue in Bitbucket, the issue will automatically be transitioned from 'Open' to 'In progress'.

Configure triggers

To see, or to set, triggers for a transition, edit the workflow that contains the transition, select the transition, then click Triggers in the properties panel for the transition.

To add a trigger to a transition:

  1. Select > Issues.
  2. Click Workflows and then Edit for the relevant workflow.
  3. In diagram mode, select the transition arrow. In text mode, select the transition's name from the Transitions (id) column.

  4. In diagram mode, click Triggers in the properties panel to show the triggers configured for the transition. In text mode, select the Triggers tab.
  5. Click Add trigger on the Triggers tab to configure a trigger.

For more information, check out Configuring workflow triggers.

Conditions

Conditions control whether a transition should be executed by the user. As examples, conditions can be used to:

  • allow only the reporter to execute a transition.
  • allow only users with a certain permission to execute a transition.
  • allow execution only if code has, or has not, been committed against this issue.

If a condition fails, the user will not see the transition button on the 'View issue' page, and so will not be able to execute the transition.

Conditions cannot validate input parameters gathered from the user on the transition's screen – you need a validator to do this.

Optional conditions

Jira includes several optional conditions that can be added to transitions.

ConditionDescription
Always False ConditionThis conditions always fails.
Block transition until approvalCondition to block issue transition if there is a pending approval.
Compare Number Custom FieldCondition to allow transition if a comparison of specified Number Custom Field to a specified value is true.
Hide From User ConditionCondition to hide a transition from the user. The transition can only be triggered from a workflow function or from REST.
Only Assignee ConditionCondition to allow only the assignee to execute a transition.
Only Bamboo Notifications Workflow ConditionOnly makes this transition available to the Bamboo build notifications.
Only Reporter ConditionCondition to allow only the reporter to execute a transition.
Permission ConditionCondition to allow only users with a certain permission to execute a transition.
Previous Status ConditionCondition to check if the issue has transitioned through a specified status or not
Separation of Duties conditionCondition preventing a user to perform the transition, if the user has already performed a transition on the issue.
Sub-Task Blocking ConditionCondition to block parent issue transition depending on sub-task status.
User Is In Any GroupCondition to allow only users in a given group to execute a transition.
User Is In Any Project RoleCondition to allow only users in a given project role to execute a transition.
User Is In Custom FieldAllows only users in a given custom field to execute the transition.
User Is In GroupCondition to allow only users in a given group to execute a transition.
User Is In Group Custom FieldCondition to allow only users in a custom field-specified group to execute a transition.
User Is In Project RoleCondition to allow only users in a given project role to execute a transition.
Value FieldAllows to execute a transition if the given value of a field is equal to a constant value, or simply set.


Add a condition

To add a condition to a transition, edit the workflow that contains the transition, select the transition, then click Conditions in the properties panel for the transition.

To add a condition to a transition:

  1. Select > Issues.
  2. Click Workflows and then Edit for the relevant workflow.
  3. In diagram mode, select the transition arrow. In text mode, select the transition's name from the Transitions (id) column.

  4. In diagram mode, click Conditions in the properties panel to show the triggers configured for the transition. In text mode, select the Conditions tab.

When you click Add condition, you can choose from the available conditions, and set any necessary parameters for the condition. Additional conditions may be available from installed plugins. or you can create your own conditions using the plugin system; see the Workflow Plugin Modules for details.

Group conditions

You can construct complex conditions by grouping and nesting conditions. Change any condition into a group by clicking the 'Add grouped condition' icon for the condition. Now you can add further conditions to this new group, as described above.

You can toggle the logic for how the conditions in a group are applied between All and Any.

Validators

Validators check that any input made to the transition is valid before the transition is performed. Input can include that gathered from the user on the transition's screen. 

If a validator fails, the issue does not progress to the destination status of the transition, and the transition's post functions are not executed. 

 Add a validator

To add a validator to a transition, edit the workflow that contains the transition, select the transition, then click Validators in the properties panel for the transition.

To add a validator to a transition:

  1. Select > Issues.
  2. Click Workflows and then Edit for the relevant workflow.
  3. In diagram mode, select the transition arrow. In text mode, select the transition's name from the Transitions (id) column.

  4. In diagram mode, click Validators in the properties panel to show the triggers configured for the transition. In text mode, select the Validators tab.

When you click Add validator, you can choose from the available validators and set any necessary parameters for the validator.

Post functions

Post functions carry out any additional processing required after a transition is executed, such as:

  • updating an issue's fields
  • generating change history for an issue
  • adding a comment to an issue
  • generating an event to trigger email notifications

Essential post functions

Every Jira transition has the following essential post functions, which are performed in this order:

  1. Set issue status to the linked status of the destination workflow status.
  2. Add a comment to an issue if one is entered during a transition.
  3. Update change history for an issue and store the issue in the database.
  4. Re-index an issue to keep indexes in sync with the database.
  5. Fire a Generic event that can be processed by the listeners. (warning) Do not edit or remove this post functionChanging this essential post function will cause unintended behavior for automations and Marketplace add-ons. If you wish to customize the post function events that fire on a transition, consider adding a custom post function and leave the default event alone.

These essential post functions cannot be deleted from a transition or reordered. However, you can insert other post functions between them.

Post functions that fire events may act differently than you expect. Jira waits to call any notification listeners until the end of the post function sequence. So, your events will fire in the order you expect, but notifications won’t be triggered until the end of the transition.

Optional post functions

Jira includes several optional post functions that can be added to transitions.

Optional post function

Description

Assign to Current User

Assigns the issue to the user who is executing the transition.

(info) This post function is ignored unless the user has the Assignable User permission. Create a condition to give the logged-in user this permission before executing the transition.

Assign to Lead Developer

Assigns the issue to the component lead, if one exists, or project lead.

Assign to Reporter

Assigns the issue to the user who created the issue.

Clear Field ValueClear value of a given field.
Copy Value From Other FieldCopies the value of one field to another, either within the same issue or from parent to subtask.
Create Crucible Review Workflow FunctionCreates a Crucible review for all unreviewed code for this issue. Requires an integration with Crucible.

Create Perforce Job Function

Creates a Perforce Job (if required) after completing the workflow transition.

Set issue security level based on user's project roleSet the issue's Security Level to the specified level if the current user is in a specified Project Role.
Trigger a Webhook

Triggers the specified webhook after completing the workflow transition.

When you add this post function, you will be asked to specify a webhook. This webhook must already be defined in Jira (see Managing webhooks).

Update Issue Custom FieldUpdates an issue custom field to a given value.

Update Issue Field

Updates one of the issue's fields to a given value. Fields that can be updated include:

  • Assignee
  • Description
  • Environment
  • Priority
  • Resolution
  • Summary
  • Original Estimate
  • Remaining Estimate

(info) This post function cannot update custom fields and must be positioned after the other optional post functions.

Additional post functions may be available from installed plugins. or you can create your own post functions using the plugin system – see the Workflow Plugin Modules for details.

 
Add a post function

To add a post function to a transition, edit the workflow that contains the transition, select the transition, then click Post functions in the properties panel for the transition.

To add a post function to a transition:

  1. Select > Issues.
  2. Click Workflows and then Edit for the relevant workflow.
  3. Select the transition:
    • In diagram mode, select the transition arrow.
    • In text mode, select the transition's name from the Transitions (id) column.
  4. Open the post functions tab:
    • In diagram mode, click Post functions in the properties panel to show the triggers configured for the transition.
    • In text mode, select the Post functions tab.
  5. Click Add post function.
  6. Add the post function and choose Publish Draft to finalize your changes.


When you click Add post function you can choose from the available post functions, and set any necessary parameters. Options for editing or deleting a post function, and for changing the execution order, are at the right of the tab (hover there to see them).

Use post functions with the initial transition

You can add post functions to a workflow's initial transition when you need to perform processing tasks – such as setting a particular field's value – when an issue is created. The initial transition is called 'Create' (if you created a blank workflow) or 'Create Issue' (if you copied the system workflow).

Jira includes the following essential post functions that are specific to a workflow's initial transition and that are performed in this order:

  1. Create the issue.
  2. Fire an event that can be processed by the listeners.

The following optional post functions are available specifically for the initial transition:

Optional post function (initial transition only)

Description

Create Comment

Adds a comment to an issue if one is entered during a transition.

Update Issue Status

Sets the issue's status to the linked status of the destination workflow status.

Store Issue

Stores updates to an issue (no change history is created).

Additionally, the standard optional post functions can also be added to an initial transition,

Optional post functions added to the Create transition must be placed before the 'Create the issue originally' post function.

If you wish, you can configure the initial status for your workflow to go to a different initial transition. See Configuring the initial status for details.

If you need to set the 'Resolution' field when creating an issue, add the 'Update Issue Field' post function after the 'Create the issue' post function and after that, use the 'Store Issue' post function. The 'Store Issue' post function is useful for setting the Resolution field during issue creation.

However, only use the Store Issue post function where necessary, since it:

  • does not generate change history
  • is unable to persist fields that have a one-to-many relationship with the issue (for example, 'Version' or 'Component')

Use a post function to set a field

You can use the 'Update Issue Field' post function to set the value of an issue's field after a particular transition is executed.

For example, you might want a transition that moves the issue to a closed status to automatically set the 'Resolution' field.

Example: Using a post function to set the Resolution field:

  1. Edit the workflow that has the transition, and drag from status to another to create a new transition.

  2. Select either None or a screen that does not contain the Resolution field.
  3. Add a new "Update Issue Field" post function and select a resolution from the Issue Field and Field Value lists.

To create a transition that clears the Resolution field, follow the same steps above for adding an 'Update Issue Field' post function to your transition. However, select None from the Field Value list.

The list of post functions for this transition includes the following statement:

  • The Resolution of the issue will be cleared.

Each time one of these transitions is executed, the Resolution of the issue is automatically set or cleared, as specified in these post functions.

Use a post function to send email notifications

Use the 'Fire an event that can be processed by the listeners' post function to fire the 'Generic Event', which is a built-in Jira event that can be used to trigger the sending of email notifications after a particular transition is executed.

Alternatively, you could fire a custom event that you've created specifically for this transition.

When a transition is performed, Jira will:

  • Look up the notification scheme associated with the issue's project and identify the users associated with the fired event;
  • Send an email notification to each user.

Example: Use a post function to fire the Generic Event to send email notifications:

  1. Create or edit your transition.
  2. Click the transition's Post Functions tab and edit the 'Fire an event that can be processed by the listeners' post function.
  3. Select Generic Event from the list of events.

Transition properties

Properties are key-value pairs that can be used to further customize transitions. For example, transition properties can help to extend a copied system workflow to allow language translations.

 To view and edit the properties of a transition:

  1. Select a transition in the diagram.
  2. Click Properties.
  3. Either:
    • Add a new property to the transition.
    • Delete a property, by clicking the icon to the right of the property. 

Important

It is not possible to edit a transition's properties on this page. To change any property's key or value (or both), you must first delete the property you wish to change and add the new updated property.

 

Note that you can also edit the transition in 'text' mode.

It is possible to implement restrictions on transitions using transition properties. For more information, see Useful workflow properties for Jira Cloud.

Global transitions

Global transitions allow any status in a workflow to transition to a particular status.

You can add a global transition:

  • When creating a new status (adding an existing status) – check the Add global transition to status option.
  • By selecting a status and checking Allow all statuses to transition to this one in the properties panel for the status.

To create two global transitions that point to the same destination step:

  1. From the workflow designer, create the first global transition as normal by selecting a step and checking Allow all statuses to transition to this one.
  2. Create the second global transition on any other step that does not currently have a global transition pointing to it.
  3. Then from text editor, select the second global transition that you created.
  4. Click Edit and change the destination step to the same step you selected for your first global transition. 
  5. When you're done, click Update
tip/resting Created with Sketch.

Do more with Jira

Discover even more ways to configure workflows with top workflow apps on the Atlassian Marketplace.

Last modified on Nov 17, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.