Example Workflow Rules
Atlassian's new transition experience in Jira is being permanently rolled out in April 2025. As a consequence, how your Jira expressions (Restrict transitions and Validate details) work will change.
Check out our Breaking Changes section for more information.
ScriptRunner for Jira Cloud provides several built-in workflow actions to help you get started with Workflows, and you can refer to our example custom scripts. You can also use one of the many Jira expression examples, which can be applied to either Restrict transitions or Validate details and on all transitions unless noted otherwise.
Example: Add a Perform actions workflow rule
By way of an example, if you would like to add a Perform actions rule to an existing Jira workflow, follow the steps below:
- Navigate to the Workflows menu from within Jira's settings. You will see Active and Inactive workflows displayed.
- Click Edit from the Actions ellipsis for your chosen workflow, and the workflow opens. You can choose to view the workflow as a diagram or text; we will use the former for this example.
- Select a transition from within the workflow diagram. A list of associated workflow functions, including Restrict transitions, Validate details, Perform actions, Triggers, and Properties, is displayed for the selected transition.
- Click Perform actions, and the workflow's transition options appear.
- Click Add perform actions rule.
- Select the ScriptRunner: Perform actions using a script option and click Select.
The Add ScriptRunner Perform Actions Rule screen appears. - Select a Perform actions rule from the list of available functions. For example, choose Add/remove from sprint.
You will now see the Configuration screen. - In the Description field, enter a short description.
- Select Enable Perform actions to enable it as soon as it is added.
- Select an Example script from the provided list of examples. These can help you get started writing your script in the console.
- Choose from the Action drop-down whether to add to a sprint or remove from a sprint.
- Choose from the Board Name drop-down whether to assign the workflow action to a particular board.
- Choose whether to run the script as an Initiating User or ScriptRunner Add-On User in the Run As dropdown.
- Click Add, and you are returned to the workflow transition, where you will see the newly added Perform actions rule appear.
Edit a Perform Actions rule
You can edit the script for the Perform actions rule directly in the workflow, or quickly access it at any time via the Workflows tab in ScriptRunner for Jira Cloud.
- Navigate to ScriptRunner > Workflows.
All existing workflows are displayed. You can refine your search by selecting the transition type from the Type drop-down list (Restrict transition, Validate details, or Perform actions) or the Workflow Status (active or inactive).
You will now see a refined list displayed. - Click the Actions ellipsis for your preferred workflow and select either Edit or Disable.
- If you choose to disable the chosen workflow, you can confirm this via a confirmation message once prompted.
- If you choose to edit the chosen workflow, you will see the workflow details screen displayed, from where you can make the required edits to an existing workflow.
For example:
- Write your script in the code editor. This code is executed when the Condition is true.
OR
Alternatively, click Example scripts to view a list of example scripts related to this feature.
So, rather than writing your own script, you can reuse one of the many examples provided, as follows:
- Choose an example script from the list provided, and the code automatically appears. You can also search for a particular script.
- Click Copy Code and then Close.
- Paste the copied code in the code editor. - Click Save.
- Write your script in the code editor. This code is executed when the Condition is true.






