Basic Youtrack CLI in python
Project description
YouTrack Python CLI
Installation
❯ pip install youtrack-python-cli
# OR, if you use virtualenvs or conda envs in your working repo, use pipx:
❯ pipx install youtrack-python-cli
Configuration
The script needs a YouTrack URL to target API requests, and a token for auth.
3 configuration methods:
-
set into current repo's git config:
❯ git config youtrack.token "$YOUTRACK_TOKEN" ❯ git config youtrack.url https://your-youtrack-server/api
-
set via environment variables,
YOUTRACK_URL
andYOUTRACK_TOKEN
-
set via command line parameters,
--url
and--token
Usage
As git pre-push hook
See the pre-push
example, which can be copied directly into
.git/hooks/pre-push
. That example checks the commit title for the YouTrack
ticket ID as the first item, for example EXAMPLE-1234 some commit title
.
Running standalone
❯ youtrack-cli --url "https://your-youtrack-server/api" --token $YOUTRACK_TOKEN get --confirm-prompt --ticket example-1234
Issue data for example-1234
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Key ┃ Value ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ idReadable │ EXAMPLE-9377 │
├───────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ summary │ Test ticket title │
├───────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ assignee_name │ Jane Doe │
├───────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ reporter_name │ jane │
├───────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ description │ Long description, truncated to max of 1024 characters │
├───────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ url │ https://your-youtrack-server/issue/EXAMPLE-1234 │
└───────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Type the ticket id to confirm: example-1234
Project details
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
Close
Hashes for youtrack_python_cli-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a010d318445d462bdcc8260b1a6f37c25487f03ff445f568afb174d66d13ef57 |
|
MD5 | 051a42b99c816539bfc916c8dd5a9da4 |
|
BLAKE2b-256 | aee4b9ce52cc9851e09eae229f265ef2a572de10bd2d5ee33309b44c68437598 |
Close
Hashes for youtrack_python_cli-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c53cf24d9cb65c6febdf22fdc946f9529c590869f6f173d7d91bc116288bbb2b |
|
MD5 | 78fef92d3ff8e246bad5a8d3caedae87 |
|
BLAKE2b-256 | dabf7536f41e6fb05372863489d4f508e013f87f18530a4fa4e9e6f874c9f3b1 |