A Python tool to retrieve ticket information from Jira API and automatically generate review announcement and approved emails for Flight Support Data Systems (FSDS) change requests.
- Retrieves ticket information directly from Jira API:
- FSDS ticket number
- Ticket title
- Reporter/author name
- Review deadline (3 weekdays from current date)
- User signature from git config
- Generates HTML-formatted review announcement emails
- Generates plain text approved emails
- Preserves email template formatting with proper indentation
- Optional automatic browser opening of generated HTML
- Saves ticket information to JSON for reuse
Main script for retrieving ticket info from Jira API and generating review announcement emails.
Script for generating approved emails from previously saved ticket JSON data.
- You need a Jira API token stored in
~/jira_api_token.txt - The token should have read access to the FSDS project in Jira
python write_review_email.py 189python write_review_email.py 189 --openAfter generating a review email, you can create an approved email:
python write_approved_email.py 189This reads the saved JSON file (FSDS-189-info.json) and generates approved email text.
python write_review_email.py --help
python write_approved_email.py --help- Python 3.6+
- Jinja2
- jira (Python Jira API library)
Install dependencies:
pip install jinja2 jira-
Create a Jira API token:
- Go to your Jira profile settings
- Generate an API token
- Save the token to
~/jira_api_token.txt
-
Ensure your token has read access to the FSDS project
write_review_email.py- Main script for review email generation (uses Jira API)write_approved_email.py- Script for approved email generationemail-template.md- Jinja2 template for review announcement emailsapproved-template.md- Jinja2 template for approved emails
The email templates support the following placeholders:
{{author}}- Ticket reporter/author name{{fsds_number}}- Full FSDS ticket identifier (e.g., "FSDS-189"){{title}}- Ticket title/summary{{review_deadline}}- Automatically calculated review deadline (3 weekdays from today){{signature}}- User's first name from git config
{{author}}- Ticket reporter/author name{{fsds_number}}- Full FSDS ticket identifier (e.g., "FSDS-189"){{title}}- Ticket title/summary{{signature}}- User's first name from git config
The script generates:
- Console output showing retrieved ticket information
- HTML file named
FSDS-{number}-review-email.htmlwith formatted review announcement - JSON file named
FSDS-{number}-info.jsonwith ticket data for later use
The script generates:
- Plain text output ready to copy/paste into email
- Console display of approved email content
BSD 3-Clause License. See LICENSE file for details.
Copyright (c) 2026, Smithsonian Astrophysical Observatory