Skip to Content
Atlassian Jiraajatv1.0.xInvoke Rules

Invoke Manual Rules

ajat invoke runs a manually-triggered Jira Cloud Automation rule against one or more target objects, the same way the “Trigger rule” button does in the Jira UI. Manual rules are fired on demand against specific issues or alerts rather than scheduled, and this command lets you fire them from a script or CI pipeline via POST /rest/v1/rule/manual/{ruleId}/invocation.

ajat invoke runs the rule against your live Jira Cloud tenant. It is plan-first: the plan (resolved rule UUID, target list, and inputs) is printed and you are prompted before the rule fires. Use —dry-run to preview and exit; use —yes to skip the prompt in automation (required when stdin is not a TTY).

ajat targets Atlassian Jira Cloud Automation only. It does not support Jira Server or Jira Data Center.

Usage

ajat invoke <rule-uuid> \ --target <PROJ-KEY|issue-key|ARI> [--target ...]... \ [--from-file <path>] \ [--input KEY=VALUE]... \ [--inputs-file <path>] \ [--dry-run] [--yes] [--format table|json]

Identify the rule by its UUID. Use ajat rule manual list to discover the manual rules that apply to a target and their UUIDs.

Flags

FlagDefaultDescription
--target <key|ari>[]Target object as an ARI or Jira issue key. Repeatable.
--from-file <path>(none)File with one target per line (blank lines and # comments ignored).
--input KEY=VALUE[]User input, sent with inputType=TEXT. Repeatable.
--inputs-file <path>(none)JSON file with the userInputs map. Overrides --input.
--dry-runfalsePrint the plan and exit without invoking the rule.
--yesfalseSkip the interactive confirmation prompt.
--format table|jsontableOutput format.

Targets

--target accepts two equivalent forms. Inputs are detected by prefix: anything starting with ari: is treated as an ARI; anything else is treated as an issue key.

FormExampleWhat happens
ARIari:cloud:jira:<cloudId>:issue/10042Passed through to the API verbatim. Also works for non-issue ARIs such as alerts.
Issue keyPROJ-123Resolved into the canonical issue ARI via GET /rest/api/3/issue/{key} before invocation. The resolution is shown in the printed plan.

A typo on an ARI will be tried as an issue key and fail with the offending input named in the error — re-run with the corrected target. Both forms can be mixed within a single command, and the input order is preserved in the plan and output.

For bulk runs, write one target per line to a file and pass --from-file. Blank lines and # comments are ignored:

# targets.txt PROJ-123 PROJ-124 ari:cloud:jira:<tenant>:alert/abc
ajat invoke 11111111-2222-3333-4444-555555555555 --from-file ./targets.txt --yes

User inputs

A manual rule in Jira can declare typed inputs — the prompts the user sees in the UI dialog. ajat invoke supplies them two ways.

--input KEY=VALUE (convenience, TEXT only)

Every value is sent as {"inputType": "TEXT", "value": "<string>"}, which covers the common case:

ajat invoke 11111111-2222-3333-4444-555555555555 \ --target ari:cloud:jira:<tenant>:issue/10042 \ --input reason="re-triage" --yes

--inputs-file <path> (full typing)

Write the userInputs object as JSON and pass it through verbatim. Use this when the rule declares NUMBER, BOOLEAN, or other non-text inputs:

{ "priority": { "inputType": "NUMBER", "value": 1 }, "escalate": { "inputType": "BOOLEAN", "value": true } }
ajat invoke 11111111-2222-3333-4444-555555555555 \ --target ari:cloud:jira:<tenant>:issue/10042 \ --inputs-file ./inputs.json --yes

—inputs-file overrides —input when both are supplied: the file is the explicit-typing escape hatch, so an operator who bothered to write it almost certainly meant it to win.

Safety model

  • The plan is always printed first: resolved rule UUID, target list, and resolved inputs.
  • --dry-run exits before any API call.
  • --yes is required when stdin is not a TTY.
  • Per-target results from the API are surfaced in the output. If any target returns a status other than SUCCESS, the command exits with code 2.

Examples

# Preview an invocation against a single issue. ajat invoke 11111111-2222-3333-4444-555555555555 \ --target ari:cloud:jira:<tenant>:issue/1001 --dry-run # Fire the rule against that issue. ajat invoke 11111111-2222-3333-4444-555555555555 \ --target ari:cloud:jira:<tenant>:issue/1001 --yes # Bulk run from a target file. ajat invoke 11111111-2222-3333-4444-555555555555 \ --from-file ./targets.txt --yes

Output

Table (default)

Invocation results TARGET STATUS ari:cloud:jira:<tenant>:issue/1001 SUCCESS ari:cloud:jira:<tenant>:issue/1002 INVALID_TARGET_OBJECT

JSON

ajat invoke 11111111-2222-3333-4444-555555555555 \ --target ari:cloud:jira:<tenant>:issue/1001 --yes --format json
{ "rule_id": "11111111-2222-3333-4444-555555555555", "results": { "ari:cloud:jira:<tenant>:issue/1001": "SUCCESS", "ari:cloud:jira:<tenant>:issue/1002": "INVALID_TARGET_OBJECT" } }

Exit codes

CodeMeaning
0Every target returned SUCCESS.
1Bootstrap / configuration / argument failure.
2At least one target returned a non-SUCCESS status.
130Interrupted by SIGINT / SIGTERM.

Discovering manual rules

To find the UUID of a manual rule, use ajat rule manual list:

ajat rule manual list --target PROJ-123 ajat rule manual list --from-file ./targets.txt --format json

  • Bulk Rule Operationsrule manual list discovers manual rules; the rule group also disables, enables, deletes, and rescopes rules in bulk.
  • Export — a full snapshot captures manual rules too.
Last updated on