Automation Manager and Analyzer
Auto Light Dark
Auto Light Dark

Experimental — Collect Large Jira Automation Audit Evidence with Python

Experimental administrator utility — unsupported Atlassian API. This procedure calls an undocumented Jira Cloud Automation internal-api endpoint. Atlassian can change it without notice. The Forge app does not call this endpoint.

Why this utility exists

Use it only when Jira's normal Audit Log download cannot provide the required evidence. It prepares local files that the Analyzer imports later; it is not a production integration or synchronization service.

Source of truth

The maintained source and tests belong in GitHub, not in Confluence code blocks:

Confluence documents how to operate the collector. GitHub keeps code, tests, review history, and security warnings in one versioned source.

Authentication

Use the email and API token of an account that can open the global Jira Automation audit log. The token is read from environment variables and is never accepted as a command-line argument.

PowerShell
$env:ATLASSIAN_EMAIL = Read-Host "Atlassian account email"
$secureToken = Read-Host "Atlassian API token" -AsSecureString
$env:ATLASSIAN_API_TOKEN = [System.Net.NetworkCredential]::new("", $secureToken).Password

Overview collection

PowerShell
py collect_automation_audit.py `
  --site "https://example.atlassian.net" `
  --timezone "America/Sao_Paulo" `
  --mode list `
  --from-time "2026-11-01T03:00:00.000Z" `
  --to-time "2026-12-01T03:00:00.000Z" `
  --output "C:\audit\automation-audit-logs-november.csv"

The listing uses paginated POST requests with offset and limit; the observed server maximum is 50 rows per page. Large output is split into CSV parts.

Complete detail

PowerShell
py collect_automation_audit.py `
  --site "https://example.atlassian.net" `
  --timezone "America/Sao_Paulo" `
  --mode detail `
  --from-time "2026-11-01T03:00:00.000Z" `
  --to-time "2026-11-02T03:00:00.000Z" `
  --output "C:\audit\automation-audit-details-one-day.json"

Detail mode makes an additional request for each selected execution. Long runtime is expected for large periods. Parts are bounded and compatible existing parts can be reused when resuming the same collection.

Rule-filtered detail

PowerShell
py collect_automation_audit.py `
  --site "https://example.atlassian.net" `
  --timezone "America/Sao_Paulo" `
  --mode detail `
  --from-time "2026-11-01T03:00:00.000Z" `
  --to-time "2026-12-01T03:00:00.000Z" `
  --rule-id "00000000-0000-0000-0000-000000000000" `
  --output "C:\audit\automation-audit-details-selected-rule.json"

Repeat --rule-id for more rules. This evidence is labelled rule-scoped in the Analyzer.

Safety and mapping behavior

  • Retries throttling, transient server failures, and network timeouts.

  • Skips administrative CONFIG_CHANGE and incomplete IN_PROGRESS rows.

  • Fails closed when a response cannot be mapped safely.

  • Preserves Atlassian's reported step total when present.

  • Detailed output excludes user data, URLs, cookies, tokens, rule values, and associated-item values.

  • Generated evidence filenames are ignored by repository Git rules, but must still be handled as sensitive Jira operational data.

Import and cleanup

Import all generated parts together. For a hybrid import, overview supplies executions and official totals; detail explains matching paths.

PowerShell
Remove-Item Env:ATLASSIAN_EMAIL -ErrorAction SilentlyContinue
Remove-Item Env:ATLASSIAN_API_TOKEN -ErrorAction SilentlyContinue

Endpoint status

The collector uses the Jira UI's internal Automation gateway under /gateway/api/automation/internal-api/jira/{cloudId}/pro/rest/GLOBAL. This is undocumented and unsupported; do not embed it in Forge, Marketplace runtime, scheduled customer services, or any contract that requires API stability.

Last updated: