Collection of Python scripts for interacting with Jira tickets.
Project description
jps-jira-utils
A clean, modular, production-grade toolkit for Jira power users
Built with Typer, rich logging, and full test coverage.
Features
add_comment.py— Add rich comments (with optional file attachments) to any Jira issue- Interactive multiline input (ends on two blank lines)
- Load comment from file (
--comment-file) - Attach files with pre-canned or custom notes (STDOUT, STDERR, log file, README, etc.)
- Final confirmation table before posting
- Full logging with structured output
- Optional custom config file (
--config-file)
- Secure credential loading via
~/.config/jps-jira-utils/.jira.env(never in code or CLI) - Clean, maintainable, fully tested codebase using modern Python best practices
- Zero external runtime dependencies beyond
requests,typer, andpython-dotenv
Installation
From source (recommended for development)
git clone https://github.com/jai-python3/jps-jira-utils.git
cd jps-jira-utils
make install # creates .venv and installs in editable mode
From PyPI (coming soon)
pip install jps-jira-utils
Configuration
Setting up credentials
The tool requires Jira Cloud credentials to authenticate API requests. By default, credentials are loaded from:
~/.config/jps-jira-utils/.jira.env
Auto-create the configuration file
You can automatically create the configuration directory and file with placeholder values:
mkdir -p ~/.config/jps-jira-utils
cat > ~/.config/jps-jira-utils/.jira.env << 'EOF'
JIRA_BASE_URL=https://your-company.atlassian.net
JIRA_EMAIL=your.email@company.com
JIRA_API_TOKEN=your_api_token_here
EOF
Then edit the file with your actual credentials:
nano ~/.config/jps-jira-utils/.jira.env
# or use your preferred editor
Manual configuration
Create the configuration directory and file manually:
mkdir -p ~/.config/jps-jira-utils
Then create ~/.config/jps-jira-utils/.jira.env with your Jira Cloud credentials:
JIRA_BASE_URL=https://your-company.atlassian.net
JIRA_EMAIL=your.email@company.com
JIRA_API_TOKEN=your_api_token_here
Generate your API token at: https://id.atlassian.com/manage-profile/security/api-tokens
Using a custom config file
If you need to use a different location for your configuration file, you can specify it with the --config-file option:
jps-add-comment JPS-1234 --config-file /path/to/custom/.jira.env
Prerequisites
Python 3.11 or higher is required.
Usage
Add a comment interactively
jps-add-comment JPS-1234
Add a comment from a file + attach a log
jps-add-comment JPS-1234 \
--comment-file results.txt \
--attach-file test-run.log
Full help
jps-add-comment --help
Development
# Format, lint, and fix everything
make fix
make format
make lint
Run tests with coverage
make test
Run pre-commit hooks (recommended)
pre-commit run --all-files
Project Structure
src/jps_jira_utils/
├── add_comment.py # Typer CLI entrypoint
├── jira_helper.py # Credential loading
├── logging_helper.py # Structured logging setup
└── prompt_helper.py # Interactive input utilities
tests/ # Includes coverage, darglint-compliant
Contributing
Contributions are welcome! Please:
Use pre-commit hooks Write tests for new features Follow Google-style docstrings Keep the codebase clean and modular
License
MIT License © Jaideep Sundaram
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jps_jira_utils-0.8.0.tar.gz.
File metadata
- Download URL: jps_jira_utils-0.8.0.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b4a9edebd72d1149a152d28e71e10c1574f3ac420705bfc863bfd4dc9b23194
|
|
| MD5 |
7f9688295878364d9e7e21163235c458
|
|
| BLAKE2b-256 |
9857c9a3055382489c4c92ca932243d8f72d994a13ba934c176619ba33dd88db
|
File details
Details for the file jps_jira_utils-0.8.0-py3-none-any.whl.
File metadata
- Download URL: jps_jira_utils-0.8.0-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cdcc024545ec1223f6fdeb13e869815cecf2c38bd0533653751057a4fc7f6a8
|
|
| MD5 |
725169126890d061e453e1bd08449a0b
|
|
| BLAKE2b-256 |
08d5c324c18f249d23f6b544f84796a7a4e28b980d9fc758dac0115098272aba
|