The Adaptavist Group LogoDocumentation

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.

Note: 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.

Warning: When you edit a custom action that is reused, the changes apply to all automation flows that use that action. Always plan and test changes in a non‑production environment before updating a reused action.

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.

Activity history

Saved automation actions keep activity 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:

  1. In Jira administration, select Marketplace apps.
  2. Under Apps, select ScriptRunner.
  3. Select Automation integrations.
  4. Select Create.
  5. Enter a Name and, optionally, a Description for your action.
  6. Choose who you want the script to Run as.
    Tip: 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 As a specific user or As app if you need the script to always run as that account, no matter who creates or edits the flow.
  7. Write your script in the editor.
    Tip: 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.
  8. Optional: Select Test automation integration, then 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.
  9. Select Publish.

Test an automation action

You can test your automation actions before adding them to an automation flow. This lets you confirm that your script behaves as expected for a given set of inputs.

Test data is the JSON object your script receives as its argument. When the action runs in a real flow, this object holds the values configured for your dynamic form fields, including any smart values the flow has substituted. When you test, you supply those values yourself.

Test your automation action as follows:

  1. When creating or editing an automation action, select Test automation integration.
    A testing panel displays.
  2. In Test data, enter the JSON your script expects.

    Test data starts empty. If your script uses dynamic forms, enter a value for each parameter, using the property names from your Parameters interface. For example:

    {
      "targetStatus": "Done",
      "maxRetries": 3
    }
    Note: If your script takes no parameters, leave the test data empty. Your script then runs with no argument, exactly as it does in a flow.
  3. Select Run.

    The Output panel shows:

    • Anything logged with console.log(...)
    • The final value returned by your script with return
  4. If necessary, edit your script and test again until the output matches your expectations.
    Warning: If your script performs updates (for example, creates or edits work items, comments, or links), those changes are applied to your Jira instance even when running tests. Always test destructive or bulk-update logic in a non-production environment first.

Testing runs your script directly, so nothing in the flow around it runs. Smart values are not substituted, and any defaults you set with @default in your Parameters interface are not filled in for you. Enter the finished values you want your script to receive.

Add your automation action to an automation flow

After you create an automation action, attach it to a specific automation flow:

  1. In Jira System settings, under Automation, select Global automation.
  2. Create or edit an automation flow. When you're ready to add your custom action, select Run a script (ScriptRunner).
  3. Select Connect.
  4. Choose your custom action from the drop-down list.
  5. Optional: If your script uses dynamic forms, fill in the input fields that appear.

    These are the configurable values defined in your script. Set them per flow, so the same action can behave differently in each one.

  6. Select Next.
  7. Continue configuring your automation flow. See Atlassian's documentation for support.

Edit an automation action

Use these steps to modify an existing automation action:

  1. In Jira administration, select Marketplace apps.
  2. Under Apps, select ScriptRunner.
  3. Select Automation integrations.
  4. Find your automation action in the list and select Edit.
  5. Modify the action as needed.

    Your changes are saved automatically as a draft. The published version keeps running in your automation flows until you publish again.

  6. Optional: Select Test automation integration, then 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.
  7. Select Publish.
Note: Any changes you publish here apply to all automation flows that use this action.

Enable and disable an automation action

You can enable or disable automation actions:

  • Globally in ScriptRunner (affects all flows that reference the action).
  • Per flow in an 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 an automation action everywhere it is used:

  1. In Jira administration, select Marketplace apps.
  2. Under Apps, select ScriptRunner.
  3. In ScriptRunner, select Automation integrations.
  4. Locate the automation action.
  5. 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:

  1. In Jira System settings, under Automation, select Global automation.
  2. Select the flow that contains your custom action.
  3. Select the Run a script (ScriptRunner) action you want to disable or enable.
  4. Check or uncheck Disable this script from running in this flow.
  5. 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:

  1. In Jira administration, select Marketplace apps.
  2. Under Apps, select ScriptRunner.
  3. Select Automation integrations.
  4. Find the automation action you want to remove.
  5. Open the ellipsis (…) menu for that action.
  6. Select Delete.
  7. When prompted, confirm that you want to delete the automation action.
Note: Deleted automation actions can be restored, including their activity 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 activity history remains available.

To restore a deleted automation action:

  1. In Jira administration, select Marketplace apps.
  2. Under Apps, select ScriptRunner.
  3. Select Automation integrations.
  4. Use the filter and select Deleted to view deleted automation actions.
  5. Find the automation action you want to restore.
  6. Open the ellipsis (…) menu for that action.
  7. Select Restore.

Search documentation

Start typing to search the docs.