Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Excerpt

A workflow condition that hides/shows a transition based on the result of Jira expression

The transition to which the condition is added will be available only if the Jira expression returns true. This can be used to test or compare issue fields, to test linked issues, to check for open Sprints, etc.

To add the 'Build-your-own (scripted) Condition' to a transition:

Image Removed

  1. Click Edit for the workflow that has the transition you wish to configure the condition on.

  2. In the Workflow Designer, select the transition.

  3. Click on Conditions in the properties panel.

  4. Click on Add condition.

  5. Select Build-your-own (scripted) Condition from the list of conditions.

  6. Click on Add to add the condition on the transition.

  7. Input a Jira expression in the Jira expression field.

  8. For information on how to write a 'Jira expression' see How to insert information using Jira expressions.

  9. Click on Add to add the condition to the transition.

Common mistakes while using this condition:

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "jira-expression"

Other related articles

When you add this condition to a transition, the add-on checks the result of the Jira expression. If the expression returns true, the transition will be available to the user, and if it returns false or a non-boolean value, the transition will be hidden.

Use case

A typical use of this workflow condition is to hide the transition when a field of the issue has a specific value or the current user belongs to a specific group.

Consider a use case where you want to show the “Approve” transition only when the current user is in the “Approvers” field. To configure this:

Add the “Build

Include Page
[Includes] Add Condition
[Includes] Add Condition

Configure the condition

  1. Follow the steps above to add a condition to a transition.

  2. From the list of validators, select Build-your-own (scripted) Condition.

  3. The Build-your-own (scripted

) condition” to the “Approve” transition
  • Input the following code under “Jira Expression”

    Code Block
    !! issue.customfield_10002 && issue.customfield_10002.some(it => it == user)
  • Note it is suggested to use the “Issue Fields” tab of the Jira expression editor, select the field from the list and the Jira expressions editor help system shows examples on accessing and testing the field value.

    See https://appfire.atlassian.net/wiki/x/KYKtB for more uses cases for this condition
    1. ) Condition page will open (Figure 1, right). Configure the condition as needed, setting the options for the description and logical test. See below for details on each of the configurations.

    2. Click Add.

    Note

    Note that you will need to publish the workflow for the new validator to take effect.

    The following configurations are available:

    • Description - Give the condition a description; this will be included in the list of conditions for the transition and in the Workflow Extensions administration page.

    • Jira Expression - The logical test for the validator. If this test evaluates to false, the validator will fail and prevent the transition from executing. Enter a Jira expression.

    Info

    You are viewing the documentation for Jira Cloud.