Description¶
Finds the highest-numbered Jira Task issue for a given openICPSR project ID. Queries the Jira API to locate tasks associated with a specific openICPSR deposit, useful for linking pipeline runs to the correct Jira ticket.
Usage¶
python3 tools/jira_find_task_by_icpsr.py <openICPSR-ID>Arguments¶
openICPSR-ID (required) - openICPSR project number (e.g., 123456)
Example¶
python3 tools/jira_find_task_by_icpsr.py 146462
# Output: AEAREP-8885Requirements¶
Python >= 3.6
jira: Python Jira library
Environment Variables Required¶
JIRA_USERNAME- Your Jira email addressJIRA_API_KEY- API token from https://id .atlassian .com /manage -profile /security /api -tokens
Behavior¶
On success: Prints the highest-numbered Jira Task issue key to stdout (e.g.,
AEAREP-8885)Not found: Prints nothing to stdout
Missing credentials: Prints nothing to stdout
Exit codes: 0 on success, 1 on usage error
The script is designed to be used in shell scripts and pipelines where the output can be captured and used to set the jiraticket variable.
Example Usage in Pipeline¶
# Automatically determine Jira ticket from openICPSR ID
if [ -z "$jiraticket" ] && [ -n "${openICPSRID:-}" ]; then
jiraticket=$(python3 tools/jira_find_task_by_icpsr.py "$openICPSRID" 2>/dev/null || true)
fiSee Also¶
jira_get_info.py - Retrieve Jira issue information
jira_add_comment.py - Post comments to Jira issues