Skip to content

Cache JIRA issues to SQLite

License

Notifications You must be signed in to change notification settings

jjrscott/jira-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Direct queries to Jira have two issues:

  1. they are sloooooow
  2. many queries are impossible with JQL

This project attempts to alleviate those problems by first caching all issues as JSON to an SQLite database, then extracting various pieces of information to 'view' tables.

Example

The following example updates the cache with all issues changes then displays all requested issues, subtasks and blocking tasks, then filters out "Done" issues from the blockers:

cache-issues.py
list-issues.py --query 'summary ~ ios AND status in ("Code review", "In Progress", "To Do") AND  AND Sprint = 10' | grep -v <0001f7e9>

Output

๐Ÿ”ถ GVO-7 Share a graph
๐Ÿ”ด GVO-8 Option to download SVG? enhancement
  ๐Ÿ”ด GVO-9 Enable resizing of panels? enhancement
  ๐Ÿ”ด GVO-11 Export as PDF
๐Ÿ”ถ GVO-12 Import from Github gist enhancement
  ๐Ÿ”ถ GVO-15 Specify the engine via the url enhancement
    ๐Ÿ”ถ GVO-21 Feature request: zoom and pan enhancement
      ๐Ÿ”ด GVO-23 Interactive display

Actions

Default parameters can be stored in ~/.jira-cache.config. For example:

[default]
jira-url=https://example.atlassian.net
jira-user=jjrscott@example.com
jira-password=...
cache-path=~/.jira-cache.sqlite

You can also use an API Token in place of your normal password.

Cache issues

usage: cache-issues.py [-h] [--jira-url JIRA_URL] [--jira-user JIRA_USER]
                       [--jira-password JIRA_PASSWORD]
                       [--cache-path CACHE_PATH] [--json] [--clear]

Cache JIRA issues in a database and generate 'view' tables to allow easier
data access (e.g. parent child relationships).

optional arguments:
  -h, --help            show this help message and exit
  --jira-url JIRA_URL   JIRA base URL
  --jira-user JIRA_USER
                        username to access JIRA
  --jira-password JIRA_PASSWORD
                        password to access JIRA
  --cache-path CACHE_PATH
                        path of the cache
  --json                output progress JSON fragments
  --clear               clear the cache

Dump issue

usage: dump-issue.py [-h] [--jira-url JIRA_URL] [--jira-user JIRA_USER]
                     [--jira-password JIRA_PASSWORD] [--fields FIELDS] --query
                     QUERY

Dump a JIRA issue to STDOUT

optional arguments:
  -h, --help            show this help message and exit
  --jira-url JIRA_URL   JIRA base URL
  --jira-user JIRA_USER
                        username to access JIRA
  --jira-password JIRA_PASSWORD
                        password to access JIRA
  --fields FIELDS       password to access JIRA
  --query QUERY         JQL to search for

List issues

usage: list-issues.py [-h] [--jira-url JIRA_URL] [--jira-user JIRA_USER]
                      [--jira-password JIRA_PASSWORD]
                      [--cache-path CACHE_PATH] [--json] [--fields FIELDS]
                      [--format {summary,branch,markdown}]
                      (--query QUERY | --filter {done_issues,my_open_issues,open_issues,reported_by_me,resolved_recently,updated_recently,viewed_recently})

Use the issues cached by cache-issues.py to add subtasks to the query results.

optional arguments:
  -h, --help            show this help message and exit
  --jira-url JIRA_URL   JIRA base URL
  --jira-user JIRA_USER
                        username to access JIRA
  --jira-password JIRA_PASSWORD
                        password to access JIRA
  --cache-path CACHE_PATH
                        path of the cache
  --json                output progress JSON fragments
  --fields FIELDS       password to access JIRA
  --format {summary,branch,markdown}
                        display format
  --query QUERY         JQL to search for
  --filter {done_issues,my_open_issues,open_issues,reported_by_me,resolved_recently,updated_recently,viewed_recently}
                        Built in queries

About

Cache JIRA issues to SQLite

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages