another-jira-cli

A cli tool for JIRA useful for time tracking and bulk ticket creation.


Keywords
jira, cli, jira-cli, python
License
MIT
Install
pip install another-jira-cli==0.12.0

Documentation

JIRA cli

A tool to interact with JIRA on the CLI. Since JIRA is crazy slow in the Atlassian hosted version and we log our times with it, this thing can so far only log work times on tickets.

Improvements are very possible :)

Requirements

  • Python >= 3.5.0
  • It seems that in ubuntu the python-dev packages should be installed for the compilation of PyYaml.

Useful examples

Get list of commands

Please use jira --help and jira COMMAND --help to get help about the available functionality. Especially try those:

  • jira -- prints list of available commands
  • jira log-work --help or jira log-time -h -- prints help for specific command

Ticket bulk creation

You can create tickets from YAML, CSV files or JSON files. The tickets must contain those fields:

  • summary
  • description
  • project
  • issuetype

Get more help on those with jira bulk-create -h.

Then just invoke jira bulk-create FILENAME [OPTIONS,...].

Limitations

You cannot create tickets which reference each other (neither uni- nor bi-directional, e.g. an epic and associated tasks).

If you want to do this, that works pretty well:

  • Create epics.yaml (or any other format, I like yaml) with all epics you want to create
  • Create tasks-for-epic-X.yaml, containing all tickets for the epic, with an invalid epic_link field (e.g. "BAAH")
  • Bulk-create the epics: jira bulk-create -p epics.yaml). the -p is important ;)
  • Now bulk-create the tasks, while setting the epic_link field on the cli: jira bulk-create tasks-for-epic-X.yaml --set epic_link=PRJ-123
  • Done.

CSV

project,issuetype,summary,description
PROJ,Task,"This is a task, eh?","... with a really cool description. Multi-line is supported in this dialect!"

YAML

- project: PROJ
  issuetype: Task
  summary: This is a task, eh?
  description: As above ... :)

JSON

[
    {
        "project": "PROJ",
        "issuetype": "Task",
        "summary": "This is a task, eh?",
        "description": "As above ... :)"
    },
    {...}
]

Time logging

$ pip install another-jira-cli
$ jira log-work EXMPL-1234 2h 30m
[...]
$ jira version
[...]
$ _

Thanks

This project utilizes the following awesome libraries:

  • click - CLIs with python
  • arrow - the human-friendly approach to dates in Python
  • jira - the JIRA helper library
  • dotmap - a dict implementation with dot.based access for members

There are also other projects probably doing much of the same things, maybe (much) more mature. If you're interested, those are the ones I've found: