Versions Compared

Key

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

Excerpt

A workflow condition

which

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 '

Scripted (Jira expression)

Build-your-own (scripted) 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
  1.  in the properties panel.

  2. Click on 

Add condition
  1. Add condition.

  2. Select 

Scripted (Groovy) Condition
  1. Build-your-own (scripted) Condition from the list of conditions.

  2. Click on Add

 to
  1.  to add the condition on the transition.

Image Removed

Related links :

Refer to the Use cases for conditions page for use
  1. Input a Jira expression in the Jira expression field.

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

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

Panel

Common mistakes while using this condition:

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

Other related articles

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

When you add this condition to a transition, the add-on checks the result of the Jira expression. If the expression

returns 

returns true, the transition will be available to the user, and if it

returns 

returns false

 or

 or a non-boolean value, the

transition will be hidden

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:

  1. Add the “Build-your-own (scripted) condition” to the “Approve” transition

  2. 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://innovalog.atlassian.net/wiki/x/GIDmOw for more uses cases for this condition.