Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

jira_download_attachments.py - Download attachments from Jira issues

Description

Downloads all attachments from a Jira issue and saves them with their original filenames to a specified directory. Supports filtering by filename pattern and list-only mode for previewing attachments. Designed for downloading manuscript PDFs and submission forms from AEA Data Editor Jira tickets.

Usage

python3 tools/jira_download_attachments.py <issue-key> [OPTIONS]

Arguments

Options

Examples

# Download all attachments to current directory
python3 tools/jira_download_attachments.py AEAREP-9354

# Download to specific directory
python3 tools/jira_download_attachments.py AEAREP-9354 --output-dir ./attachments

# Download only PDF files
python3 tools/jira_download_attachments.py AEAREP-9354 --filter ".pdf"

# Download only manuscripts
python3 tools/jira_download_attachments.py AEAREP-9354 --filter "manuscript"

# Download only forms
python3 tools/jira_download_attachments.py AEAREP-9354 --filter "form"

# List attachments without downloading
python3 tools/jira_download_attachments.py AEAREP-9354 --list

# Verbose mode
python3 tools/jira_download_attachments.py AEAREP-9354 --verbose

Automation Script

A convenient wrapper script is available that automatically reads the Jira ticket from config.yml:

# Download all attachments from ticket in config.yml
bash automations/30_download_commit_jira_attachments.sh

# List attachments first
bash automations/30_download_commit_jira_attachments.sh --list

# Download only manuscripts
bash automations/30_download_commit_jira_attachments.sh --filter manuscript

# Download only forms
bash automations/30_download_commit_jira_attachments.sh --filter form

Requirements

Environment Variables Required

To obtain a Jira API token:

  1. Visit https://id.atlassian.com/manage-profile/security/api-tokens

  2. Click “Create API token”

  3. Copy the token and set it as JIRA_API_KEY environment variable

Output

Typical Workflow

For AEA replication packages, each Jira ticket typically has two attachments:

  1. A manuscript (PDF)

  2. A submission form (PDF or Word document)

Recommended workflow:

# 1. Check what attachments are available
bash automations/30_download_commit_jira_attachments.sh --list

# 2. Download all attachments to repository root
bash automations/30_download_commit_jira_attachments.sh

Or download selectively:

# Download manuscript only
bash automations/30_download_commit_jira_attachments.sh --filter manuscript

# Download form only
bash automations/30_download_commit_jira_attachments.sh --filter form

Behavior

See Also