A script condition is a workflow condition that allows you to extend the functionality you find in a basic Jira workflow condition. A condition checks to make sure that a requirement is met before you can transition an issue. If the script returnsfalsethe transition button is not available for an issue until the condition is met.
There are several ways to enhance your workflow using script conditions, including:
Allow a transition only if the summary starts with specified characters.
Restrict transitions if certain fields are not present.
Enforce that the issue must have at least one PDF file attachment to transition.
Allow only certain users to transition an issue.
ScriptRunner for Jira Cloud provides workflow conditions using theJira Expression Framework. It is not possible to use the REST API.
Navigate toContext Variablesto see the variables provided by this framework that can be used to create expressions. Click thevariablesto view the properties that can be called.
Create Condition
Select the transition you wish to add the condition to.
ClickConditions→Add Condition.
Select theScriptRunner Scriptoption thenAdd.
Enter theName of ScriptRunner Script Condition.
In theScriptRunner Script Conditionfield, enter the script condition expression. This script condition must be written as aJira expression.
For help navigating to ScriptRunner workflow functions, follow the steps to navigate toworkflow functions.
Edit Condition
Select the transition the condition is on.
ClickConditions. A list of all conditions on the selected transition is shown.