Workflow Actions
Learn how to create, test, attach, and manage scripted workflow actions that run when a work item transitions to a new status.
With ScriptRunner, you can automatically update fields, create or link related work items, or send notifications as part of the transition. This helps you enforce business rules, reduce manual steps, and maintain workflow consistency.
Workflow actions run as part of a work item transition, so there can be a short delay between the transition happening and your script running. For more information, see Performance and latency on the Scripting limitations page.
Atlassian has updated its workflow terminology as part of the new workflow editor experience. Some names and concepts may differ from what you're used to in the classic editor. For a detailed description of the changes, refer to Atlassian's official workflow documentation.
Scripted workflow action reuse
You can create a scripted workflow action once in ScriptRunner and reuse it across multiple workflows and transitions. This helps you:
- Maintain common logic in a single place (for example, notifications, task creation, field synchronization).
- Apply consistent behavior across spaces and workflows.
Output and logging
When you test a script, the output panel shows:
- Anything logged with
console.log(...). - The final value returned by your script with
return. - The error, if the script failed, with the full untrimmed error behind Full error.
Use console.log(...) for messages, intermediate values, or debugging, and include a return statement for the main result you want to display.
Activity history
Saved workflow actions keep activity history, so you can review when they were run, and what the output was, making it easier to audit and troubleshoot. For how long activity is kept, see Run history retention.
Supported spaces
Workflow rules are available in company-managed spaces only. Team-managed spaces are not currently supported.
ScriptRunner's workflow rules do not appear as options when you edit a team-managed workflow, so you cannot add them there.
Create a scripted workflow action
Follow these steps to create a new scripted workflow action in ScriptRunner:
Add your scripted workflow action to a workflow transition
After you create a scripted workflow action, attach it to a specific transition in a workflow:
Test a scripted workflow action
You can test your scripted workflow actions against JSON data for work items before using them on real screens. This lets you confirm that your script behaves as expected for a specific work item. Test data is the JSON data that describes the work item and transition your scripted workflow action runs against. For scripted workflow actions, the JSON data typically includes:
issue: the work item and its core fields (for example,id,key,fields.summary,fields.status,fields.priority,fields.assignee, and so on).transition: details of the workflow transition (for example,id,name,from,to, and anexecutionId).changelog: information about what changed during the transition (for example, fields that were updated).atlassianId: the ID of the user who triggered the transition.context: additional information about where and how the action is running (for example,cloudId,moduleKey, anduserAccessflags).
The full JSON data is shown in the test panel so you can see exactly what data your workflow action receives when the transition runs.
Test your workflow action as follows:
Edit a scripted workflow action
Use these steps to modify an existing scripted workflow action:
Enable and disable a scripted workflow action
You can enable or disable scripted workflow actions:
- Globally in ScriptRunner (affects all transitions that reference the action).
- Per transition in a specific workflow (affects only that transition).
Use global enable/disable to stop an action everywhere. Use transition‑level enable/disable when you only want to pause or remove it from a specific workflow path.
Enable or disable globally
- In Jira administration, select Marketplace apps.
- Under Apps, select ScriptRunner.
- In ScriptRunner, select Workflow actions.
- Locate the scripted workflow action.
- Open the ellipsis (…) menu for that action and select Disable or Enable.
Enable or disable a specific transition
To enable or disable a scripted workflow action on a single transition:
Delete a scripted workflow action
Remove scripted workflow actions you no longer need to keep your list organized and reduce clutter. When you delete a scripted workflow action, it's removed from your active Workflow actions list and is no longer available on workflow transitions. Any workflows and transitions that referenced the action may still run, but the deleted script will no longer run as part of those transitions.
To delete a scripted workflow action:
- In Jira administration, select Marketplace apps.
- Under Apps, select ScriptRunner.
- Select Workflow actions.
- Find the scripted workflow action you want to remove.
- Open the ellipsis (…) menu for that action.
- Select Delete.
- When prompted, confirm that you want to delete the scripted workflow action.
Restore a deleted scripted workflow action
When you restore a scripted workflow action, it becomes available again in ScriptRunner and is reconnected to any active workflows and transitions that previously used it. Those transitions will start running the script again the next time they are executed, and the action's activity history remains available.
To restore a deleted scripted workflow action:
- In Jira administration, select Marketplace apps.
- Under Apps, select ScriptRunner.
- Select Workflow actions.
- Use the filter and select Deleted to view deleted scripted workflow actions.
- Find the scripted workflow action you want to restore.
- Open the ellipsis (…) menu for that action.
- Select Restore.