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.

download_from_jira_url.py - Download replication packages from Jira-specified URLs

Description

This script orchestrates downloads from various repositories (Dataverse, Zenodo, OSF) using the replication package URL stored in a Jira issue. It automatically detects the repository type, checks for openICPSR deposits, and calls the appropriate download tool with the correct parameters.

Usage

python3.12 tools/download_from_jira_url.py <issue-key>
python3.12 tools/download_from_jira_url.py -h|--help

Arguments

Examples

# Download replication package for a Jira issue
python3.12 tools/download_from_jira_url.py AEAREP-8983

# Show help
python3.12 tools/download_from_jira_url.py --help

Workflow

The script follows this sequence:

  1. Check openICPSR: Verifies if openICPSR Project Number is populated in Jira

    • If yes: exits with code 2 (openICPSR handled separately)

    • If no: proceeds to next step

  2. Retrieve URL: Gets “Replication package URL” from Jira issue

  3. Detect Repository: Analyzes URL to determine repository type:

    • Dataverse: URLs containing “DVN” or “dataverse”

    • Zenodo: URLs containing “zenodo”

    • OSF: URLs containing “osf.io

  4. Download: Calls appropriate download tool:

    • Dataverse: download_dv.py (extracts DOI)

    • Zenodo draft: download_zenodo_draft.py (for /deposit/ URLs)

    • Zenodo public: download_zenodo_public.sh (for /record/ URLs)

    • OSF: download_osf.sh (if available)

  5. Git Integration: Handles staging/commit in CI mode

Repository Detection

Dataverse

Recognizes URLs matching:

Extracts DOI and passes to download_dv.py.

Zenodo

Recognizes URLs matching:

Detects draft vs. public based on /deposit/ in URL path.

OSF

Recognizes URLs containing:

Note: OSF download not yet fully implemented in this script.

Output Structure

Downloads create repository-specific directories:

Exit Codes

Prerequisites

Required Environment Variables

Optional Environment Variables

Required Tools

Git Integration

In CI Environments

When CI environment variable is set:

In Local Environments

Error Handling

The script handles various error conditions:

URL Parsing Examples

Dataverse

Input URLExtracted DOI
https://doi.org/10.7910/DVN/ABC123doi:10.7910/DVN/ABC123
https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/ABC123doi:10.7910/DVN/ABC123
https://dataverse.example.edu/file.xhtml?persistentId=doi:10.5072/DVN/XYZ789doi:10.5072/DVN/XYZ789

Zenodo

Input URLRecord IDType
https://zenodo.org/record/12345671234567Public
https://zenodo.org/deposit/12345671234567Draft
10.5281/zenodo.12345671234567Public
https://zenodo.org/records/1234567812345678Public

Requirements

Integration with Pipeline

This script is designed to integrate with the AEA replication workflow:

# Example bitbucket-pipelines.yml usage
script:
  - python3.12 tools/download_from_jira_url.py $JIRATICKET

Can replace or supplement existing openICPSR/Zenodo download logic for cases where the replication package is hosted on alternative repositories.

See Also

Troubleshooting

“No Replication package URL found in Jira issue”

Cause: The “Replication package URL” field is not populated in the Jira issue.

Solution:

  1. Check the Jira issue in browser

  2. Verify the “Replication package URL” field contains a valid URL

  3. Ensure Jira credentials are correctly configured

“Could not extract DOI from Dataverse URL”

Cause: URL format doesn’t match expected Dataverse patterns.

Solution:

  1. Verify the URL is a valid Dataverse URL

  2. Ensure the URL contains either a DOI or DVN identifier

  3. Check for typos in the URL

“Could not extract record ID from Zenodo URL”

Cause: URL format doesn’t match expected Zenodo patterns.

Solution:

  1. Verify the URL is a valid Zenodo URL

  2. Ensure the URL contains a numeric record ID

  3. Try using just the record ID number instead of full URL

“openICPSR deposit found (exit code 2)”

Cause: The Jira issue has an openICPSR Project Number populated.

Solution: This is intentional behavior. openICPSR deposits are handled separately through download_openicpsr-private.py or download_openicpsr-public.py.

Known Limitations

Future Enhancements

Potential improvements: