Jira Automation Integration

Overview

JiBrok Studio integrates with Jira Automation as a custom action. You can add the “Run JiBrok Studio Script” action to any automation rule to execute a script from your library.

Scripts run with the configured actor (defaults to Application). This makes them ideal for system-level automations that don’t depend on a specific user’s permissions.


Setup

1. Enable the Automation Trigger Type

In the Administration panel, ensure the Automation trigger type is enabled globally.

2. Add an Automation Trigger to a Script

  1. Open a script in the Console
  2. Go to the Config tab
  3. Click Add Trigger and select Automation
  4. Save the script

The script must be enabled and have an enabled Automation trigger to be available in Jira Automation.

Add Automation trigger to script

Script returning JSON for automation

3. Create an Automation Rule

  1. In Jira, go to Project Settings > Automation (or global automation)
  2. Create or edit a rule
  3. Add the action “Run Script - JiBrok Studio”
  4. Configure the inputs (see below)

Add component to automation rule

Search for JiBrok Studio action


Action inputs

Input Required Description
Script Yes The script to execute (selected by script ID)
Issue Key No The issue key to pass to the script. Use {{issue.key}} smart value to pass the triggering issue
Action Input No Additional data passed to the script as params.actionInput. Supports smart values - use it to pass custom strings, JSON, or any value from earlier rule components

Inside the script, read the Action Input via params.actionInput:

// Passed via Action Input: {{issue.summary}} - {{now}}
log("Received:", params.actionInput)

Automation action script selection

Automation action configuration


Output smart values

The action produces smart values available to subsequent rule components:

Smart value Type Description
{{triggeredJiraScript.success}} boolean Whether the script executed successfully
{{triggeredJiraScript.result}} string Script return value (string, number, or JSON object)
{{triggeredJiraScript.error}} string Error message if script execution failed
{{triggeredJiraScript.executionMs}} integer Script execution time in milliseconds

Accessing fields from a JSON result

If your script returns an object (e.g. return { status: "done", count: 5 }), the result is delivered as a JSON string. Use jsonStringToObject() to parse it and access individual fields:

  • {{jsonStringToObject(triggeredJiraScript.result)}} - the parsed object
  • {{jsonStringToObject(triggeredJiraScript.result).status}} - access a specific field
  • {{jsonStringToObject(triggeredJiraScript.result).count}} - access another field

Automation log result data

Automation log JSON parse result


Example automation rule

Scenario: When a high-priority issue is created, run a script that assigns a reviewer and posts a Slack-style comment.

  1. Trigger: Issue created
  2. Condition: Priority = Highest or High
  3. Action: Run Script - JiBrok Studio
    • Script: “Auto-assign reviewer”
    • Issue Key: {{issue.key}}
  4. Condition: {{triggeredJiraScript.success}} equals true
  5. Action: Log or send notification with {{triggeredJiraScript.result}}

Automation rule overview

Automation rule execution log result

Automation audit log results


Run Script (List) action

In addition to Run Script - JiBrok Studio, the app also provides Run Script (List) - JiBrok Studio - a variant that iterates over an array returned by the script and runs subsequent rule branches once per element.

Use it when a script computes a list of items and you want the rest of the automation rule (send email, add comment, create sub-task, etc.) to execute for each item.

How it works

  1. The script must return an array - each array element becomes one iteration.
  2. Inside the following rule branches, each element is exposed via the list smart values.
  3. Primitive elements (strings, numbers) are stringified; object elements are serialized to JSON.

Action inputs

Input Required Description
Script Yes The script to execute - must return an array
Issue Key No Issue key to pass to the script. Use `` smart value
Action Input No Same as for the single-script action - forwarded to params.actionInput. Supports smart values

List smart values

Smart value Type Description
value string String representation of the list item (JSON if element is an object)
index integer Zero-based index of the item in the array

Example

// Script: return a list of overdue issue keys
return Issues.search('duedate < now() AND resolution is EMPTY')
  .map(i => i.key)

Then in the automation rule:

  1. Action: Run Script (List) - JiBrok Studio -> the script above
  2. Following branches run once per returned key, with the key available as a list smart value

Important notes

  • Scripts run with the configured actor (defaults to Application) - see the script’s Config tab to change the execution identity
  • The script must have an enabled Automation trigger - otherwise the action will fail
  • The Automation trigger type must be enabled in Administration
  • Standard execution limits apply

Next steps