Jira CLI Kit
A female rabbit is called a doe. A male rabbit is called a buck. A baby rabbit is called a kit.
This is a command-line tool to interact with Jira Cloud to create tickets and add comments to existing tickets.
It uses a configuration file (~/.jira.cfg) for default settings and allows command-line arguments to override these defaults.
Setup
Install
git clone git@gitlab.com:q-os/security.git
pip install ./security/projects/jiracli # locally
pip install jiraclikit # from PyPI
1. Create a Jira API Token
To interact with Jira Cloud, you need to generate an API token:
- Go to Jira API Token page.
- Log in with your Jira account.
- Click on Create API token.
- Name the token and click Create.
- Copy the token and save it securely.
2. Set Environment Variables
Store the Jira API URL and token as environment variables for secure access:
export JC_JIRA_URL="https://yourdomain.atlassian.net" # Replace with your Jira domain
export JC_JIRA_TOKEN="your_jira_api_token" # Replace with the generated API token
3. Initial Run Configuration
When you run the tool for the first time, it will prompt you to enter:
- Default Project ID: The Jira project ID where tickets will be created.
- Default Parent Task ID (optional): A parent ticket ID if you often create subtasks under a specific epic or task.
These will be saved in the ~/.jira.cfg file.
Examples
Creating a Ticket
To create a new ticket in Jira:
python jira_cli.py -s "Ticket Title" -m "Detailed description of the ticket" -p "PROJECT_ID" -e "PARENT_TASK_ID" -t "tag1,tag2"
- This will create a ticket with the specified title, message, project, parent task, and tags.
- If
-por-eis not specified, the tool will fall back to the defaults in~/.jira.cfg, unless-nis used.
Adding a Comment to a Ticket
To add a comment to an existing ticket:
python jira_cli.py -c "TICKET_ID" -m "Your comment here"
- This will add the provided comment to the specified ticket.
Using "No Defaults" Mode
To ignore the .jira.cfg settings and use only the provided CLI arguments:
python jira_cli.py -s "New Ticket Without Defaults" -p "ANOTHER_PROJECT_ID" -n
Configuration File (~/.jira.cfg)
The configuration file will look like this:
[DEFAULT]
project_id = YOUR_DEFAULT_PROJECT_ID
parent_task = YOUR_DEFAULT_PARENT_TASK_ID
The settings here are automatically created on the first run if they don't already exist.
Notes
- Environment Variables: Ensure the
JIRA_URLandJIRA_API_TOKENare set before running the tool. - Command-line Override: CLI arguments override the config file values.
- Error Handling: If any required parameter is missing, the script will raise an error and prompt for correction.
Publish
python -m pip install --upgrade pip build twine
python -m build --sdist && python -m build --wheel
twine upload ./dist/* -u __token__ -p $PYPI_API_KEY
Metadata
Release files for jiraclikit 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jiraclikit-1.0.0.tar.gz | 4.7 kB | Without provenance | Details for jiraclikit-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jiraclikit-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for jiraclikit-1.0.0-py3-none-any.whl |
Total release size: 9.6 kB
Release files / jiraclikit-1.0.0.tar.gz
| Download URL | jiraclikit-1.0.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
72c090efaeb1a407d2c6edd248f7d62e1f0b740c06805ef6e331d01d8745455f
|
|
BLAKE2b-256 checksum How to use checksums |
86ad986ac91d10227e482f943d0620c9bc47de85a08c1b480262c20d016f6a0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Release files / jiraclikit-1.0.0-py3-none-any.whl
| Download URL | jiraclikit-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b2983e9beb8a7b9c9830d142380cfca9f6665e5564ecf9f11b01d50fbf7de0ec
|
|
BLAKE2b-256 checksum How to use checksums |
f8eb107c6d33fa3e3b0bfa2995dd1d0d2fc1a39e624806c22b1dfeb63f2b82be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Security for jiraclikit 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.