Automation Integrations
Use Automation integrations to create custom actions that you can run inside Jira automation flows. This allows you to implement logic that extends beyond native automation actions, such as complex updates, cross-space operations, or external integrations.
When your script runs
Actions run as part of an automation flow, so there can be a short delay between the flow running and your script running. For more information, see Performance and latency on the Scripting limitations page.
Custom action reuse
You can create a custom action once in ScriptRunner and reuse it across multiple automation flows. This helps you:
- Maintain common logic in a single place (for example, notifications, task creation, field synchronization).
- Apply consistent behavior across spaces.
To make a reused action flexible without duplicating it, use dynamic forms to add configurable input fields to your script. This means the same action can serve different use cases across flows, with different values set for each, without requiring any code changes.
Run as and connections
When you add the Run a script (ScriptRunner) action to an automation flow, you must Connect to Jira as a user. This connection defines which Jira user account is used when your custom action runs. This behaves similarly to the Run as option you configure when creating the script in ScriptRunner:
- If your script's Run as is set to As current user, the action will run as the connected user (the user who added the ScriptRunner action to the flow).
- This is the recommended setup when the same script is reused in multiple actions or flows created by different users.
- If you explicitly set Run as in the script to a specific user or to the ScriptRunner app, that setting overrides the connection role.
- In this case, the script always runs as the specified user or as the app, regardless of who created the automation flow or which user is connected in the flow.
Output and logging
When you run a script, the output panel shows:
- Anything logged with
console.log(...) - The final value returned by your script with
return
Use console.log(...) for messages, intermediate values, or debugging, and include a return statement for the main result you want to display. Each time you select Run, the output panel is cleared and refreshed with the latest logs and return value.
Execution history
Saved automation actions keep a full execution history (under Output), so you can review when they were run, and what the output was, making it easier to audit and troubleshoot.
Create an automation action
Follow these steps to create a new automation action in ScriptRunner:
- In Jira administration, select Marketplace apps.
- Under Apps, select ScriptRunner.js.
- Select Automation integrations.
- Select Create.
- Enter a Name and, optionally, a Description for your action.
- Choose who you want the script to Run as.
Choose the right Run as option
- Choose As current user if you want the script to run as the user who connects the action in the automation flow (we recommend this option for shared scripts).
- Choose a Impersonate user or As app if you need the script to always run as that account, no matter who creates or edits the flow.
- Write your script in the editor.
To help you write scripts, you can use the automation action examples, use HAPI, or select Example scripts directly in the script editor. You can also use dynamic forms to add configurable input fields to your script, making it reusable across multiple automation rules without any code changes.
- Optional: Select Run to run your script and make sure it works as expected.
- If the script performs updates (for example, creates or edits work items), those changes are applied to your Jira instance.
- Test in a non‑production environment first.
- Use the Output panel to review results and troubleshoot any errors.
- Select Save.
Add your automation action to an automation flow
After you create an automation action, attach it to a specific automation flow:
- In Jira System settings, under Automation, select Global automation.
- Create or edit an automation flow. When you're ready to add your custom action, select Run a script (ScriptRunner).
- Select Connect.
- Choose your custom action from the drop-down list.
- Select Next.
- Continue configuring your automation flow. See Atlassian's documentation for support.
Edit a automation action
Use these steps to modify an existing automation action:
- In Jira administration, select Marketplace apps.
- Under Apps, select ScriptRunner.js.
- Select Automation integrations.
- Find your automation action in the list and select Edit.
- Modify the action as needed.
- Optional: Select Run to run your script and make sure it works as expected.
- If the script performs updates (for example, creates or edits work items), those changes are applied to your Jira instance.
- Test in a non‑production environment first.
- Use the Output panel to review results and troubleshoot any errors.
- Select Save.
Any changes you save here apply immediately to all automation flows that use this action.
Enable and disable a automation action
You can enable or disable automation actions:
- Globally in ScriptRunner (affects all flows that reference the action).
- Per flow in a automation flow (affects only that script in a flow).
Use global enable/disable when you want to stop an action everywhere. Use flow‑level enable/disable when you only want to pause or remove it from a specific automation flow.
Enable or disable globally
To enable or disable a automation action everywhere it is used:
- In Jira administration, select Marketplace apps.
- Under Apps, select ScriptRunner.js.
- In ScriptRunner, select Automation integrations.
- Locate the automation action.
- Open the ellipsis (…) menu for that action and select Disable or Enable.
This setting applies to every automation flow that references the action. Disabling it here prevents the script from running anywhere, without needing to edit each flow.
Enable or disable a specific flow
You can disable an entire Jira automation flow, or you can control just your custom action by disabling only the ScriptRunner step in that flow.
To enable or disable an automation action in a single flow:
- In Jira System settings, under Automation, select Global automation.
- Select the flow that contains your custom action.
- Select the Run a script (ScriptRunner) action you want to disable or enable.
- Check or uncheck Disable this script from running in this flow.
- Select Update to save the flow change.
Delete an automation action
Remove automation actions you no longer need to keep your list organized and reduce clutter. When you delete an automation action, it’s removed from your active Automation integrations list and is no longer available to automation flows. Any flows that referenced the action may still run, but the deleted script will no longer run as part of those flows.
To delete an automation action:
- In Jira administration, select Marketplace apps.
- Under Apps, select ScriptRunner.js.
- Select Automation integrations.
- Find the automation action you want to remove.
- Open the ellipsis (…) menu for that action.
- Select Delete.
- When prompted, confirm that you want to delete the automation action.
Deleted automation actions can be restored, including their execution history.
Restore a deleted automation action
When you restore an automation action, it becomes available again in ScriptRunner and is reconnected to any active automation flows that previously used it. Those flows will start running the script again the next time they are triggered, and the action’s execution history remains available.
To restore a deleted automation action:
- In Jira administration, select Marketplace apps.
- Under Apps, select ScriptRunner.js.
- Select Automation integrations.
- Use the filter and select Deleted to view deleted automation actions.
- Find the automation action you want to restore.
- Open the ellipsis (…) menu for that action.
- Select Restore.