Versions Compared

Key

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

A workflow condition which hides/shows a transition based on the result of either a custom expression or a scripted Groovy expression

To add the 'Scripted (Groovy) Condition' to a transition:

  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 Scripted (Groovy) Condition from the list of conditions.
  6. Click on Add to add the condition on the transition.
    Image Removed
  7. Input a Groovy expression in the Groovy script field.
  8. For information on how to write a 'Groovy expression' see Using Groovy with JMWE.
  9. Click on Add to add the condition to the transition.
Panel

Related links :

Refer to the Use cases for conditions page for use cases for this condition.

For information on how to write a Groovy script, see Using Groovy with JMWE.

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

The Build-your-own condition will either hide or show a transition based on the outcome of the included expression - when the expression evaluates to true (or “truthy” in the case of Groovy expressions) the transition will be available; otherwise the transition will not be available. There are two options for creating an expression:

  • No Code - Build an expression to test the value of a field using standard operators (e.g. “equals/does not equal”, “greater than/less than”, and “is empty/is not empty” among others). Field values can be compared to other fields or to static values.

  • Groovy Script - For even greater flexibility, build a Groovy expression that evaluates to true or false (or truthy/falsey). For more information on using Groovy in JMWE, see Using Groovy with JMWE.

Note: the No Code option for this Condition lets you build a Groovy script using several fields to configure which field should be evaluated, and the conditions that the field value must meet in order to evaluate to true or false. Once the No Code fields have been configured, a Groovy script will be generated for you! The Condition can be saved as configured, and it will remain a No Code condition or it can be switched to a Groovy script condition that automatically uses the generated script.

Alternately, the generated Groovy script can be copied so it can be updated and/or customized outside of JMWE.

Include Page
[Includes] Adding a Condition
[Includes] Adding a Condition

Configure the condition

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

  2. From the list of conditions, select Build-your-own Condition.

  3. Click Add.

  4. The Build-your-own Condition page will open (Figure 1, right). Configure the condition as needed. See below for details on each of the configurations.

  5. Click Add.

Options

The following options are available:

  • Description - Give the condition a description. The Description will be displayed in the list of conditions for a Transition.

  • Choose Type - Select either No Code to build a condition using standard logical operators, or select Groovy Script to enter a Groovy expression.

  • Field - Only available when Choose Type, above, is set to No Code. Select the field to be evaluated.

  • Operator - Only available when Choose Type, above, is set to No Code. Select the logical operator to use in the field evaluation.

  • Value to compare type - Only available when Choose Type, above, is set to No Code. Configure whether to compare the field value to another field or to a static value.

  • Value to compare - Only available when Choose Type, above, is set to No Code. This field updates based on the setting for Value to compare type:

    • Field - When value to compare type is set to ‘Field’, this field is a pulldown menu used to select the comparing field to use in evaluation.

    • Text - When value to compare type is set to ‘Text’, this field is a text field where a static value can be entered.

  • Regex - Only available when Choose Type, above, is set to No Code and Operator is set to Matches a regular expression/Does not match a regular expression. The regular expression to use in the field evaluation.

  • Compiled script - Only available when Choose Type, above, is set to No Code. After all other fields have been configured, the compiled script will be displayed (Figure 2, right). The Compiled script window includes two buttons:

    • Test ( (blue star) ) - Test the compiled script against an existing issue to determine the outcome.

    • Copy ( (blue star) ) - Copy the compiled script to the clipboard.

  • Groovy script - Only available when Choose Type, above, is set to Groovy script.

Info

You are viewing the documentation for Jira Data Center/Server.

On This Page

Table of Contents
minLevel1
maxLevel2
outlinefalse
typelist
printablefalse
Image AddedImage Added