Giter Club home page Giter Club logo

go-jira-ui's Introduction

go-jira-ui

go-jira-ui is an ncurses command line tool for accessing JIRA.

Screenshot showing issue list from ad-hoc query

It is built around the excellent go-jira and termui libraries.

It aims to be similar to familiar tools like vim, tig, and less.

In order to use this, you should configure an 'endpoint' as per the go-jira documentation:

$ cat ~/.jira.d/config.yml
---
endpoint: https://jira.example.com/
user: bob   # if not same as $USER

This should be all that's needed to get going.

Installation

# Make sure you have GOPATH and GOBIN set appropriately first:
# eg:
#   export GOPATH=$HOME/go
#   export GOBIN=$GOPATH/bin
#   mkdir -p $GOPATH
#   export PATH=$PATH:$GOBIN
go get -v github.com/mikepea/go-jira-ui/jira-ui

Dockerised use

docker run --rm -it -v /path/to/.jira.d:/config pmjohann/go-jira-ui

Features

  • Supply your own JQL queries to view
  • Label view of a given query, to see categorisations easily
  • Sorting of queries; supply your own custom sorts
  • View tickets from the query
  • Drill into sub/blocker/related/mentioned tickets in details view
  • Show open tickets in an Epic.
  • Basic compatibility with go-jira commandline and options loading
  • Label adding/removing
  • Comment, watch, assign and take implemented via :-mode commands

At present, edit will exit after the update. This is a workaround to an implementation issue, being tracked in #8

Usage

jira-ui is intended to mirror the options of go-jira's jira tool, where useful:

jira-ui             # opens up in Query List page. Default interface.
jira-ui ISSUE       # opens up Ticket Show page, with ISSUE loaded
jira-ui ls -q JQL   # opens up Ticket List page, with results of JQL loaded.
jira-ui -h          # help page

Basic keys

Actions:

<enter>      - select query/ticket
r            - mark ticket for ranking (use naviation to change rank, <enter> to submit)
L            - Label view (query results page only)
E            - Edit ticket
S            - Select sort order (query results page only)
w            - Watch the selected ticket
W            - Unwatch the selected ticket
v            - Vote for the selected ticket
V            - Remove vote on the selected ticket
N            - Next ticket in results
P            - Previous ticket in results
h            - show help page

Commands (like vim/tig/less):

:comment {single-line-comment} - add a short comment to ticket
:label {labels}                - add labels to selected ticket
:label add/remove {labels}     - add/remove labels to selected ticket
:take                          - assign ticket to self
:assign {user}                 - assign ticket to {user}
:unassign                      - unassign ticket
:watch [add/remove] [watcher]  - watch ticket (optionally as a different user)
:vote                          - vote for the selected ticket
:unvote                        - remove vote for the selected ticket
:view {ticket}                 - display {ticket}
:query {JQL}                   - display results of JQL
:search|so {text}              - quick search for {text} in open tickets
:search-all|sa {text}          - quick search for {text} in all tickets
:spo {project} {text}          - quick search for {text} in open {project} tickets
:spa {project} {text}          - quick search for {text} in all {project} tickets
:help                          - show help page
:<up>                          - select previous command
:quit or :q                    - quit

Searching:

/{regex}                       - search down
?{regex}                       - search up

Navigation:

up/k         - previous line
down/j       - next line
C-f/<space>  - next page
C-b          - previous page
}            - next paragraph/section/fast-move
{            - previous paragraph/section/fast-move
n            - next search match
g            - go to top of page
G            - go to bottom of page
q            - go back / quit
C-c/Q        - quit

Configuration

It is very much recommended to read the go-jira documentation, particularly surrounding the .jira.d configuration directories. go-jira-ui uses this same mechanism, so can be used to load per-project defaults. It also leverages the templating engine, so you can customise the view of both the query output (use 'jira_ui_list' template), and the issue 'view' template.

go-jira-ui reads its own jira-ui-config.yml file in these jira.d directories, as not to pollute the go-jira config. You can add additional queries & sort orderings to the top-level Query page:

$ cat ~/jira.d/jira-ui-config.yml:
sorts:
  - name: "sort by vote count"
    jql:  "ORDER BY votes DESC"
queries:
  - name: "alice assigned"
    jql:  "assignee = alice AND resolution = Unresolved"
  - name: "bob assigned"
    jql:  "assignee = bob AND resolution = Unresolved"
  - name: "unresolved must-do"
    jql:  "labels = 'must-do' AND resolution = Unresolved AND ( project = 'OPS' OR project = 'INFRA')"

Learning JQL is highly recommended, the Atlassian Advanced Searching page is a good place to start.

go-jira-ui's People

Contributors

coryb avatar feriority avatar mikepea avatar oclaussen avatar pmjohann avatar punya-asapp avatar rsteube avatar sebastianrakel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-jira-ui's Issues

Support CmdEdit from go-jira

Editing tickets is hopefully pretty straightforward.

Use 'e' from TicketList and TicketShow to edit the selected issue.

termui.v2 fails to build -- undefined: stack.ParseDump/stack.Aggregate

Termui.v2 fails to build when running go get -v github.com/mikepea/go-jira-ui/jira-ui. I have tested on both my Mac and in a Docker container.

Running the following to attempt to build go-jira-ui in a Docker container as a test environment.

❯ docker run -it --rm golang:alpine ash

/go # go get -v github.com/mikepea/go-jira-ui/jira-ui
...
gopkg.in/gizak/termui.v2
# gopkg.in/gizak/termui.v2
src/gopkg.in/gizak/termui.v2/render.go:107:15: undefined: stack.ParseDump
src/gopkg.in/gizak/termui.v2/render.go:112:15: undefined: stack.Aggregate

/go # go version
go version go1.15.2 linux/amd64

Looking into the issues on the gizak/termui repository that seem to be relevant most of the solutions seem to be to upgrade to the latest version of Termui.

Any help/suggestions would be appreciated! I'm gonna attempt to figure out how to fix this myself later today but thought I would post this here in case anyone has suggestions. Will update with a fix/pull request if I figure out how to fix.

Changing state/status of tickets

I'm missing a way to updated status of a ticket directly from go-jira-ui, unless I am missing something. Perhaps command :status could be added to change a ticket when viewing it?

Fix paging in TIcketShowPage

Paging is weak in TicketShowPage, largely due to 'wrap' mode in the termui.List element. There doesn't appear to be a way of finding this out.

Options:

  • Submit a PR to termui to get this support in place. It should be feasible and handy.
  • Work around it, by calculating the wrapping (bletch, but feasible)
  • Use our own wrapping (meh, but would mean we could split lines more intelligently, and would help make #4 more useful)

Custom sorts for TicketList.

Sometimes you want to look at tickets from a create date perspective, sometimes by last update.

We should support useful sort orderings, as per the JIRA UI.

Make TicketList page 'immutable'; add refresh key

Doing the API query to ensure the TIcketList page has up-to-date results is expensive, and makes the interface somewhat sluggish.

Instead, if we kept the cachedResults and had a 'refresh' option, we can work around this in an acceptable way.

'R' for refresh results.

Kanban Support

Jira supports Kanban boards. It would be nice if go-jira-ui supported viewing and interacting with them. At a minimum, being able to view a board would be nice. Ideally, you would also be able to easily preview an issue and move it to a different column.

' "VpnGateways":' breaks line highlighting.

This is an example of a class of problems.

      "VpnGateways":

... becomes

 [      "VpnGateways": [](fg-white,bg-blue)

when highlighted.

Something is screwy, but it's not obvious what from the above. Fix it!

Paste does not work, mangles output

If you paste text into the command buffer, (eg view {paste-ticket-id}), it gets mangled.

There's nothing in the way of buffering, w/r/t Key events, so this is kind of expected.

It needs fixing though, not sure how as yet.

Can't install on macOS

I get:

$ export GOPATH=$HOME/go
$ export GOBIN=$GOPATH/bin
$ mkdir -p $GOPATH
$ export PATH=$PATH:$GOBIN
$ go get -v github.com/mikepea/go-jira-ui/jira-ui
github.com/mikepea/go-jira-ui
# github.com/mikepea/go-jira-ui
go/src/github.com/mikepea/go-jira-ui/ui_controls.go:170:10: e.Data undefined (type termui.Event has no field or method Data)
go/src/github.com/mikepea/go-jira-ui/ui_controls.go:269:10: e.Data undefined (type termui.Event has no field or method Data)

System details:

macOS 10.14.1 running Go version go1.11.2 darwin/amd64.

Am I missing anything?

Thanks!

After editing issue key actions no longer works

I open jira-ui, select a query, use down-arrow to select an issue, enter to view issue. Then "E" to edit the issue, I see edit screen, make a change and exit out of edit and back to viewing issue. At this point navigation is dead, I cannot "q" back to the query results, and "P" and "N" do not go away from issue. In fact it seems like no keys work, include C-c q, so I cannot even exit. The only way to get back to console is it open another console and kill the process. No idea what the root cause of this is.

Add support for Transitions

On a per-ticket basis, provide a select-box (a'la sort order) that will let the user select an available transition, like 'In Progress', or 'Done'.

Some care is needed here - how would we set the close 'resolution' for example.

Add support for PassCmd config option

What you think about passwordeval option in config. file? It would allow user to read password from keychain or tools like that - without putting them in config file in plain text.

Give option to disable default queries

I'd like my custom queries to be at the top of the page and I'm not gonna use the default ones now that I defined mine. Adding an option to disable default queries would be great :)

When login token times out, 'Password: ' prompt is spewed out.

I've been wondering how this would materialise, as there is no graceful handling of this condition - when a re-login to JIRA is needed, CmdLogin will potentially trigger.

It's just happened, and 'Password: ' prompt was displayed. I typed my password, it was accepted and the token refreshed. I'm sort of amazed this worked. However, I doubt it will in every situation, and obvs not a solution.

Really this involves figuring out how to do this in-interface.

Fails to install on debian 9


github.com/gizak/termui
# github.com/gizak/termui
go/src/github.com/gizak/termui/render.go:107: not enough arguments in call to stack.ParseDump
go/src/github.com/gizak/termui/render.go:112: undefined: stack.Palette
go/src/github.com/gizak/termui/render.go:113: undefined: stack.SortBuckets
go/src/github.com/gizak/termui/render.go:113: undefined: stack.Bucketize
go/src/github.com/gizak/termui/render.go:114: undefined: stack.CalcLengths```

Implement SelectItem() in TicketShowPage

We can select lines in TicketShow, we may as well utilise it.

If an issue ID appears on that line (so of the form [A-Z]+-[0-9]+), do TicketShow on that issue ID.

Make a help page

Seriously, no-one will read the README.

'h', as per every ncurses interface in the world, ever.

go-jira-ui fails to compile on golang 1.7.5

Using the default installation steps I am getting the following error on OSX Sierra using homebrew golang 1.7.5

$ go get -v github.com/mikepea/go-jira-ui/jira-ui
github.com/mikepea/go-jira-ui
# github.com/mikepea/go-jira-ui
../base_list_page.go:100: log.Debugf undefined (type *logging.Logger has no field or method Debugf)
../base_list_page.go:101: log.Debugf undefined (type *logging.Logger has no field or method Debugf)
../base_list_page.go:114: log.Debugf undefined (type *logging.Logger has no field or method Debugf)
../base_list_page.go:115: log.Debugf undefined (type *logging.Logger has no field or method Debugf)
../command_bar.go:26: log.Debugf undefined (type *logging.Logger has no field or method Debugf)
../command_bar.go:31: log.Debugf undefined (type *logging.Logger has no field or method Debugf)
../command_bar_fragment.go:20: log.Debugf undefined (type *logging.Logger has no field or method Debugf)
../command_bar_fragment.go:26: log.Debugf undefined (type *logging.Logger has no field or method Debugf)
../command_bar_fragment.go:32: log.Debugf undefined (type *logging.Logger has no field or method Debugf)
../command_bar_fragment.go:48: log.Debugf undefined (type *logging.Logger has no field or method Debugf)
../command_bar_fragment.go:48: too many errors

Give option to edit default queries

Issue #26 was resolved by shifting default queries down instead of allowing to disable them. This is fine in my mind, however in my use-case the default queries are not valid and therefore even less useful as they are by default.

My suggestion is therefore to implement a way of editing the default queries. Would this be possible? :)

Export favorite filters

I was surprised when my queries, uh, "filters", from Jira didn't show up. It would be helpful to be able to export those (the filter definitions are available via API).

Ticket ID matching does not support extended format.

We need to find ticket IDs in plaintext, for a couple of reasons:

  • It means we can do the drill-down from the TicketShow page, where ticket IDs are in the comments, blockers, ... fields
  • The TicketList page currently works on a template, so we actually pull the ticketID out from the raw string.

@Feriority found this in #23 -- https://confluence.atlassian.com/jira/changing-the-project-key-format-192534.html -- which indicates that we need to perform a better match.

Also, it's probably worth adding some logic to the TicketList page to pull the ticket IDs out via the API response, rather than via findTicketIdInString(). More robust, innit.

Browse tickets (Open in browser)

Go-jira has the ability to issue the command :browse to open a ticket in the browser. I would love to see this possible also in go-jira-ui. Would this be possible? Thanks!

command history is kinda lame

Command history is not preserved across pages, only saves one command, and invalid commands are kept.

Update it to:

  • Maintain state across pages
  • Include a proper history
  • Keep a ':' and 'search' list

Improve date formatting

Instead of displaying dates like "2016-01-04T11:15:42.000+0000" it would be nice to be able to see them as 10 days ago/3 hours ago.

I am already working on a patch for this 👍

Drill into Epics somehow

The JIRA API does report the tasks within an Epic in the API request for that ticket. It's possible to do this via a query though.

Allow for drilling into an Epic ticket in a way that presents the user with the list of those tickets. Unresolved is probably ok, for brevity.

implement adding/removing watcher

This would be a really useful cli command, so I could filter out the ticket ID in a mutt keybinf and add myself as a watcher.. without a browser window.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.