Git Product home page Git Product logo

jira-cli's People

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jira-cli's Issues

Change default browser

Discussed in #248

Originally posted by klammbueddel January 6, 2022
Great tool, just just stumbled across it and fell in love.

I am using it in WSL. I tried a lot to change the default browser (update-alternatives --config x-www-browser, setting BROWSER variable), but still Google Chrome within WSL is started. I'd like to open issues in Firefox of my host which works fine with wslview.

How can I tell jira-cli to use wslview as default browser?

Thank you for this awesome tool!

Can't build, undefined error with github.com/yuin/goldmark

➜ jira_go go get github.com/ankitpokhrel/jira-cli/cmd/jira
go: found github.com/ankitpokhrel/jira-cli/cmd/jira in github.com/ankitpokhrel/jira-cli v0.0.0-20210323162451-7ea7fb0ad495

github.com/charmbracelet/glamour/ansi

../../go/pkg/mod/github.com/charmbracelet/[email protected]/ansi/renderer.go:75:15: undefined: "github.com/yuin/goldmark/extension/ast".KindFootnoteBackLink

➜ jira_go go version
go version go1.15.7 darwin/amd64

Tried to work around error by installing goldmark with go get, but still receiving the same error.

State paramenter on sprint list doesnt appear to do anything

Describe the bug

When I do the following 3 commands, I get the same output, regardless of what state the issues are in:

jira sprint list 99
jira sprint list 99 -p API --state closed
jira sprint list 99 -p API --state active

Please provide following details

  1. JiraCLI Version:
    (Version="0.3.0", GitCommit="ea53355d5b72994a5b17a63e6e800ce9d8a23f4e", CommitDate="2022-01-09T19:50:19+00:00", GoVersion="go1.17.5", Compiler="gc", Platform="linux/amd64")
    
  2. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
    Jira cloud
    
  3. What operating system are you using? Also mention version.
    Ubuntu 20.04.2 LTS running in WSL2 on Windows 11 Pro version 10.0.22000
    
  4. What terminal are you using? Also mention version.
    Windows terminal Version 1.11.3471.0
    

To Reproduce

Steps to reproduce the behaviour:
Run the commands as above. You should see the same output.

Expected behavior

It should filter the issue list with the applied filter

Screenshots

image

Install failed

Hi,

I've got this error when trying to install

$ go get github.com/ankitpokhrel/jira-cli/cmd/jira
package github.com/russross/blackfriday/v2: cannot find package "github.com/russross/blackfriday/v2" in any of:
	/usr/lib/go-1.13/src/github.com/russross/blackfriday/v2 (from $GOROOT)
	/home/bdupuis/go/src/github.com/russross/blackfriday/v2 (from $GOPATH)

Installing after installing blackfriday v2 works

go get github.com/russross/blackfriday/v2

Best regards,

enable `--debug` flag for `init`?

So, I just spent some time trying to set this up and had some difficulty, apparently my API token was no good.

However, the --debug flag exists globally, but it specifically looks to not do a lot for the init subcommand. I would expect jira init --debug to give some useful output.

I got as far as:
generator.go line 170 changing that to:

	c.jiraClient = api.Client(jira.Config{
		Server: server,
		Login:  login,
		Debug:  viper.GetBool("debug"),
	})

But then I did not see that debug output reflected in client.go line 130:

func (c *Client) request(ctx context.Context, method, endpoint string, body []byte, headers Header) (*http.Response, error) {
	if c.debug {
		fmt.Printf("\nRequesting %s: %s\n", method, endpoint)
		fmt.Printf("With request body: %s\n", string(body))
		fmt.Printf("With request headers: %v\n", headers)
	}

And to be honest, before I went any further I added debug messages directly and saw I was getting a 401.

That aside, it would be nice to have --debug for init - including possibly defer() in that function to print out the response if debug is set?

Alternatively, maybe https://github.com/j0hnsmith/connspy/ if you don't want to roll your own?

reproducible builds

The benefits associated with reproducible builds (and the costs associated with non-reproducible builds) are better explained here:
https://reproducible-builds.org/

tldr; reproducible builds are good and jira-cli would be improved by having reproducible builds.

edit Makefile: add `clean` target

Is your feature request related to a problem? Please describe.
There is no clean target in the Makefile.

Describe the solution you'd like
A clean target in the Makefile that supports the deletion of build artifacts from the git worktree. This may require overriding GOCACHE such that build artifacts are actually created within the git worktree.

Describe alternatives you've considered

  • go clean ./...
  • git clean -ffxd

Additional context
The clean target is one of the Standard Targets mentioned in the GNU Make Manual. Having such a target is A Good Thing.

References:

--plain not working as expected

Describe the bug
Command: jira issue list -a$(jira me) --plain
The following text is offsetting the text output.
"⠧ Fetching issues..."

Please provide following details

  1. JiraCLI Version:
(Version="0.2.0", GitCommit="06888ef8934a2b95d4a729cc024f11e485239a36", GoVersion="go1.17.2", BuildDate="2021-11-20", Compiler="gc", Platform="darwin/amd64")
  1. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
Jira cloud
  1. What operating system are you using? Also mention version.
macOS Catalina 10.15.7
  1. What terminal are you using? Also mention version.
iTerm 2 Build 3.4.3

To Reproduce

Steps to reproduce the behavior:

  1. Run this command: "jira issue list -a$(jira me) --plain"
  2. Check the first line of the output.
  3. If you see this text "⠧ Fetching issues...", then it is a problem.

Expected behavior
We should not see this text in the first line "⠧ Fetching issues..." for at least --plain option.

Screenshots
image

Additional context

jira init fails when selecting default board for on-premise install

Describe the bug
I ran jira init to connect to my JIRA on-premise server, however after selecting the default board, the program panicked.

Please provide following details

  1. JiraCLI Version:
    (Version="0.1.0", GitCommit="b2f09ec08a3d277de9e3530621572184de2ecf7a", GoVersion="go1.17.2", BuildDate="2021-10-31"", Compiler="gc", Platform="darwin/amd64")
    
  2. Are you using Jira cloud or on-premise jira server?
    On-premise
    
  3. What operating system are you using? Also mention version.
    macOS Monterey 12.0.1 (21A559)
    
  4. What terminal are you using? Also mention version.
    alacritty 0.9.0 (fed349a)
    

To Reproduce

Steps to reproduce the behavior:

  1. Export JIRA password to JIRA_API_TOKEN shell variable
  2. Run jira init and follow prompts
  3. See error after selecting default board

Expected behavior
I have not used jira-cli before, but I would expect it would finish setup and allow me to run further commands

Screenshots
image

Additional context
This might depend on the board setup, but I'm not sure how to provide that to you. We are using a Kanban board setup
Panic information here:

panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
github.com/ankitpokhrel/jira-cli/internal/config.(*JiraCLIConfig).configureMetadata(0xc0006fdcf8)
	/Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/internal/config/generator.go:303 +0x651
github.com/ankitpokhrel/jira-cli/internal/config.(*JiraCLIConfig).Generate(0x17c2860)
	/Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/internal/config/generator.go:79 +0x74
github.com/ankitpokhrel/jira-cli/internal/cmd/init.initialize(0xc0006b1900, {0x1855e8e, 0x0, 0x0})
	/Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/internal/cmd/init/init.go:29 +0x65
github.com/spf13/cobra.(*Command).execute(0xc0006b1900, {0x1f9deb0, 0x0, 0x0})
	/Users/ankitpokhrel/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0xc0006b1680)
	/Users/ankitpokhrel/go/pkg/mod/github.com/spf13/[email protected]/command.go:960 +0x3ad
main.main()
	/Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/cmd/jira/main.go:12 +0x1e

Epic add fails in next-gen project

Discussed in #185

Originally posted by winslowb November 7, 2021
Hi,

I'm trying to view issues in an epic. I receive and error that I need to edit the issue and assign a parent but I've not been able to successfully add the issue to the epic.

I've tried to

  • jira epic add GPE-134 GPE-171 (134 is the epic and 171 is the issue)
  • jira issue edit GPE-171 "parent":{"key":"GPE-134"}

image

✗ Unable to generate configuration: Config File "config" Not Found in "[]"

Describe the bug
After running jira init i receive the following error

▶ jira init
? Installation type: Cloud
? Link to Jira server: https://invoca.atlassian.net
? Login email: [email protected]
? Default project: TECH
? Default board: Engineering Backlog Scrumban Board
⠋ Creating new configuration...
✗ Unable to generate configuration: Config File "config" Not Found in "[]"

Please provide following details

  1. JiraCLI Version:
    (Version="0.3.0", GitCommit="ea53355d5b72994a5b17a63e6e800ce9d8a23f4e", CommitDate="2022-01-09T19:50:19+00:00", GoVersion="go1.17.5", Compiler="gc", Platform="darwin/amd64")
    
  2. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
    Cloud
    
  3. What operating system are you using? Also mention version.
    MacOs 10.15.7
    
  4. What terminal are you using? Also mention version.
    iTerm2 Build 3.4.12
    

To Reproduce

Steps to reproduce the behavior:

  1. install as documented
  2. run jira init
  3. See error

Expected behavior
no errors

`jira issue create` fails for classic project

Describe the bug

Please provide following details

  1. JiraCLI Version:
(Version="0.2.0", GitCommit="06888ef8934a2b95d4a729cc024f11e485239a36", GoVersion="go1.17.2", BuildDate="2021-11-20", Compiler="gc", Platform="darwin/amd64")
  1. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
Cloud
  1. What operating system are you using? Also mention version.
macOS Catalina 10.15.7
  1. What terminal are you using? Also mention version.
iTerm 2 Build 3.4.12

To Reproduce

Steps to reproduce the behavior:

jira issue create
? Issue type Oppgave
? Summary test
? Description <Received>
? What's next? Submit
⠼ Creating an issue...
Error:
  - issuetype: Sakstypen valgt er ugyldig.

The error "Sakstypen valgt er ugyldig" is Norwegian for "Invalid issue type"

Additional context

Here's my .config/.jira/.config.yml generated by jira init:

board:
  id: REDACTED
  name: REDACTED
  type: kanban
config: ""
debug: false
epic:
  name: ""
  link: ""
installation: Cloud
issue:
  types:
  - id: "10011"
    name: Historie
    subtask: false
  - id: "10030"
    name: Oppgave
    subtask: false
  - id: "10031"
    name: Deloppgave
    subtask: true
  - id: "10032"
    name: Feil
    subtask: false
  - id: "10000"
    name: Epos
    subtask: false
login: REDACTED
project:
  key: BIBL
  type: classic
server: https://REDACTED.atlassian.net/

If I switch to another project, which has type: next-gen, it works to create issues. I only have these two projects to test with.

JSON Output

Really glad I found this project! Allows me to do many things very quickly.

I am creating a small CLI app that uses this app to automate some parts of my flow and it would really help if there was an option to display the output in json format. Now I am parsing the --plain which works but doesn't feel the most stable.

feature request: jira issue sprint

Please consider opening a discussion in idea category for the proposed feature if applicable.

Is your feature request related to a problem? Please describe.
I have sprints. I have issues. I would like a way to associate the latter with the former.

Describe the solution you'd like
jira issue sprint ISSUE-KEY SPRINT

Describe alternatives you've considered
Using a web browser, but that sucks because Jira web pages suck.

Additional context
I don't know how common the "Sprint" attribute is for your "normal" Jira configurations, but my personal anecdata suggests that it's overwhelmingly popular.

jira epic list --plain

Describe the bug

jira epic list --plain | grep <something>

hangs indefinitely.

Please provide following details

  1. JiraCLI Version:

    jira version
    (Version="", GitCommit="", GoVersion="go1.16.2", BuildDate="", Compiler="gc", Platform="darwin/amd64")
    
  2. What operating system are you using? Also mention version.

    macOS 12.0.1 Monterey
    
  3. What terminal are you using? Also mention version.

    iTerm2 (Version 3.4.12)
    

To Reproduce

Steps to reproduce the behavior:

  1. jira epic list
  2. pipe the above into grep
  3. See error

Expected behavior
Is jira epic list working with --plain? What I want to achieve is to be able to filter by epic titles when I do not remember the epic key number. Moreover, given the current state, would it not be possible instead to show a dynamic list of epics that can be filtered agains (like in case of users or metadata flags for issues)?

`make lint` fails with make 3.81

Just a quick report since I couldn't get it to build:

$ make lint
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [lint] Error 2

using the default make on macOs 10.15.7:

$  make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

It helped to install a newer make:

$ brew install make
[…]
GNU "make" has been installed as "gmake".

$ gmake -v
GNU Make 4.3
Built for x86_64-apple-darwin19.6.0
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ gmake lint
golangci/golangci-lint info checking GitHub for tag 'v1.43.0'
golangci/golangci-lint info found version: 1.43.0 for v1.43.0/darwin/amd64
golangci/golangci-lint info installed ~/gocode/bin/golangci-lint

401 Unauthorized when accessing account on Ubuntu 20.04 with ssh

Hi! I love this project, it's the solution I never knew I needed.

The CLI isn't working for me, and I suspect because it's because my company account only allows us to sign in with Okta.

Steps I followed:

  • Installed the binary on my dev environment using the go get option
  • Created a JIRA API key and set it as an environment variable
  • Ran jira init
    • Typed in the URL of my company's (cloud) JIRA server
    • Typed in my login email

After I hit enter on my login email, I got this output:

⠋ Verifying login details...
✗ Received unexpected response '401 Unauthorized' from jira. Please try again.

I'm assuming that this problem is happening because I use Okta to login to Jira. Is there anything I can do to get around this? Thanks!

without `tty`, `jira issue list` produces no output and hangs

Describe the bug
Without a pseudoterminal, jira issue list hangs and produces (almost) no output.

Please provide following details

  1. JiraCLI Version: 0.1.1, installed via go install github.com/ankitpokhrel/jira-cli/cmd/[email protected]
    (Version="", GitCommit="", GoVersion="go1.17.1", BuildDate="", Compiler="gc", Platform="linux/amd64")
    
  2. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
    No.
  3. What operating system are you using? Also mention version.
    $ lsb_release --all
    Distributor ID:	Ubuntu
    Description:	Ubuntu 18.04.6 LTS
    Release:	18.04
    Codename:	bionic
    
  4. What terminal are you using? Also mention version.
    $ gnome-terminal --version
    # GNOME Terminal 3.28.2 using VTE 0.52.2 +GNUTLS -PCRE2
    

To Reproduce

$ nohup jira issue list 2>&1 & 
[1] 20842
nohup: ignoring input and appending output to 'nohup.out'
$ jobs -l
[1]+ 20842 Stopped (tty output)    nohup jira issue list 2>&1
$ kill -SIGKILL 20842
[1]+  Killed                  nohup jira issue list 2>&1
$ awk 1 nohup.out 
⠸ Fetching issues... 

Expected behavior
jira-cli should detect that standard output is not a terminal and fall back to printing --plain output.

Screenshots
See "To Reproduce" above.

Additional context
None.

Trailing slash in Cloud server url causes " Unable to generate configuration" error

Describe the bug

Doing jira init then going with "Cloud" and a URL with a trailing slash (ie https://company.atlassian.net/) causes an error:

$ jira init
? Installation type: Cloud
? Link to Jira server: https://fpstudio.atlassian.net/
? Login email: [email protected]
? Default project: PP
? Default board: Pipeline Board
⠋ Creating new configuration...
✗ Unable to generate configuration: Config File "config" Not Found in "[]"

then if I do the same but no trailing slash, it works:

$ jira init
? Config already exist. Do you want to overwrite? Yes
? Installation type: Cloud
? Link to Jira server: https://<redacted>.atlassian.net
? Login email: alan@<redacted>.com
? Default project: PP
? Default board: Pipeline Board
⠼ Configuring metadata. Please wait...
✓ Configuration generated: /home/alan/.config/.jira/.config.yml

Please provide following details

  1. JiraCLI Version:
    (Version="v0.3.0", GitCommit="", CommitDate="", GoVersion="go1.17.5", Compiler="gc", Platform="linux/amd64")
    
  2. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
    Jira Cloud -- no idea where to see the version.
    
  3. What operating system are you using? Also mention version.
    Ubuntu 20.04 LTS
    
  4. What terminal are you using? Also mention version.
    Windows Terminal Preview
    Version: 1.12.3472.0
    

To Reproduce

Steps to reproduce the behavior:

  1. export your JIRA_API_TOKEN env var then jira init
  2. Pick Cloud
  3. Enter server URL with a slash at the end and continue with your email.
  4. Pick project and board.
  5. See error.

Expected behavior
I expect URLs with slashes not to fail.

Screenshots

image

Additional context

Seems similar bug to #255 (which was closed so I made a new ticket.)

add navigation commands in --help

I have been trying out and using jira-cli: it is awesome!

I have noticed that the --help does not list the navigation commands as per here: do you think it is useful to add them to the help, so that users do not have to come to the GitHub url in case they forget (I find myself using c and CTRL+K often but I forget which is which)?

Ability to list issues in several projects

I would like to list issues spanning multiple projects, for example corresponding to this JQL query:

project in (APP, WEB, AI) AND labels in (backend)

Perhaps by providing a comma separated list to --project?

Segfault upon viewing issue from explorer

Describe the bug

Opening the issue explorer with the following command, then pressing v on an issue, brings up a segmentation violation.

❯ jira issue list -s"Open" -t~"Epic" --columns key,assignee,status
⠸ Fetching issues... panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0x1718567]

goroutine 27 [running]:
github.com/ankitpokhrel/jira-cli/internal/view.Issue.String({0x0, {0x0, 0x0, 0x0, {0x0, 0x0, 0x0}}})
        /Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/internal/view/issue.go:42 +0x67
github.com/ankitpokhrel/jira-cli/internal/view.IssueList.Render.func1.2({0x1787a60, 0x0})
        /Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/internal/view/issues.go:66 +0x77
github.com/ankitpokhrel/jira-cli/pkg/tui.(*Table).initTable.func2.1.1()
        /Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/pkg/tui/table.go:199 +0x25
github.com/rivo/tview.(*Application).Suspend(0xc0003ac460, 0xc0006b3f88)
        /Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/vendor/github.com/rivo/tview/application.go:519 +0xa9
github.com/ankitpokhrel/jira-cli/pkg/tui.(*Table).initTable.func2.1()
        /Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/pkg/tui/table.go:199 +0x157
created by github.com/ankitpokhrel/jira-cli/pkg/tui.(*Table).initTable.func2
        /Users/ankitpokhrel/go/src/github.com/ankitpokhrel/jira-cli/pkg/tui/table.go:192 +0x1a5

Please provide following details

  1. JiraCLI Version:
    (Version="0.1.1", GitCommit="6663763b44a2e5d328b551ae7d2f1a37d1e232ae", GoVersion="go1.17.2", BuildDate="2021-11-03"", Compiler="gc", Platform="darwin/amd64")
    
  2. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
    Jira Server v8.20.0
    
  3. What operating system are you using? Also mention version.
    macOS 12.0.1
    
  4. What terminal are you using? Also mention version.
    alacritty 0.9.0 (fed349a)
    

To Reproduce

Steps to reproduce the behavior:

  1. jira issue list -s"Open" -t~"Epic" --columns key,assignee,status
  2. Press v on an issue.
  3. Witness the error

Expected behavior

Issue detail view opens.

jira issue view not showing comments

Apologies for opening so many issues (I am just using the tool a lot!). I have noticed that jira issue view <ticker-nr> does not by default parse comments text. Is this intended behaviour or did I miss the documentation explaining how to visualise comments?

Likewise using jira issue comment lets you submit a comment but does not display the comments section either.

404 error: jira issue list --limit=$((1<<31))

Describe the bug
The upper limit on the jira issue list --limit is an undocumented 2147483647; i.e., 2**31 - 1

Please provide following details

  1. JiraCLI Version:
    $ jira version
    (Version="v0.3.1-0.20220124201418-5429cbd9d363", GitCommit="", CommitDate="", GoVersion="go1.17.6", Compiler="gc", Platform="linux/amd64")
    
  2. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
    cloud
    
  3. What operating system are you using? Also mention version.
    Ubuntu 20.04
    
  4. What terminal are you using? Also mention version.
    $ gnome-terminal --version
    # GNOME Terminal 3.36.2 using VTE 0.60.3 +BIDI +GNUTLS +ICU +SYSTEMD
    

To Reproduce

$ jira issue list --plain --limit="$(((1 << 31) - 1))" >/dev/null 2>&1 ; echo $?
0
$ jira issue list --plain --limit="$(((1 << 31) - 0))" ; echo $?
⠹ Fetching issues... 
jira: Received unexpected response '404 Not Found'.
Please check the parameters you supplied and try again.
1

Expected behavior

Some kind of error message blaming the size of the limit, and not an error message reporting a 404.

Screenshots

Not applicable.

Additional context

Not applicable.

Could not generate configuration

Hello, I have a situation setting up the cli.
I've configured as described in the steps and got to generating the configuration which failed:

? Default board: None
⠋ Creating new configuration...
✗ Unable to generate configuration: Config File "config" Not Found in "[]"

Thanks

Makefile default target `all` does too much

Describe the bug
The Makefile default (first non-special built-in) target all depends on the targets deps, lint, test, and install. This last one is especially troublesome, as a naive make in the worktree will install a freshly built program to $GOPATH/bin or $HOME/go/bin if GOPATH is undefined.

Please provide following details

  1. JiraCLI Version:
    $ jira version
    (Version="main", GitCommit="3bcebf9a7c55977dc42d895e4caa01805924fb19", GoVersion="go1.17.5", BuildDate="2022-01-01T16:13:06UTC", Compiler="gc", Platform="linux/amd64")
    
  2. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
    cloud
    
  3. What operating system are you using? Also mention version.
    Ubuntu 20.04
    
  4. What terminal are you using? Also mention version.
    $ gnome-terminal --version
    # GNOME Terminal 3.36.2 using VTE 0.60.3 +BIDI +GNUTLS +ICU +SYSTEMD
    

To Reproduce

Steps to reproduce the behavior:

$ rm -vf "${GOPATH:-${HOME}/go}/bin/jira" && make && ! test -x "${GOPATH:-${HOME}/go}/bin/jira"

Expected behavior
Invoking make does not install anything.

Screenshots
Not applicable.

Additional context
Not applicable.

Pick up the password/passkey from the .netrc file

Instead of having to put the passkey into an ENV variable, and store it in my dot files, can we pick also pick it up from the .netrc file? I have a number of other tools that uses the .netrc file to store the jira keys and it would be a plus to have everything use the same location.

jira issue view does not respect locale

Describe the bug
jira issue view prints non-ascii characters forbidden by the current locale.

Please provide following details

  1. JiraCLI Version:
    $ go install github.com/ankitpokhrel/jira-cli/cmd/[email protected] && jira version 
    (Version="dev", GitCommit="", GoVersion="go1.17.3", BuildDate="", Compiler="gc", Platform="linux/amd64")
    
  2. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
    cloud
    
  3. What operating system are you using? Also mention version.
    ubuntu 18.04
    
  4. What terminal are you using? Also mention version.
    $ gnome-terminal --version
    # GNOME Terminal 3.28.2 using VTE 0.52.2 +GNUTLS -PCRE2
    

To Reproduce

$ LC_ALL=C jira issue view --plain FOOBAR-1000 2>/dev/null  | tr -d '\000-\177' | wc -c
46

Expected behavior

$ LC_ALL=C jira issue view --plain FOOBAR-1000 2>/dev/null  | tr -d '\000-\177' | wc -c
0

Screenshots
not applicable

Additional context
not applicable

fix usage: jira issue comment add

Describe the bug
The COMMENT_BODY is documented as a mandatory positional argument even though it's not.

Please provide following details

  1. JiraCLI Version:
$ go install github.com/ankitpokhrel/jira-cli/cmd/jira@e229260dcdf04b855555feac7ba063bac3795257 && jira version
(Version="dev", GitCommit="", GoVersion="go1.17.5", BuildDate="", Compiler="gc", Platform="linux/amd64")
  1. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
cloud
  1. What operating system are you using? Also mention version.
$ cat -n /etc/os-release 
     1	NAME="Ubuntu"
     2	VERSION="20.04.3 LTS (Focal Fossa)"
     3	ID=ubuntu
     4	ID_LIKE=debian
     5	PRETTY_NAME="Ubuntu 20.04.3 LTS"
     6	VERSION_ID="20.04"
     7	HOME_URL="https://www.ubuntu.com/"
     8	SUPPORT_URL="https://help.ubuntu.com/"
     9	BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
    10	PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
    11	VERSION_CODENAME=focal
    12	UBUNTU_CODENAME=focal
  1. What terminal are you using? Also mention version.
$ gnome-terminal --version 
# GNOME Terminal 3.36.2 using VTE 0.60.3 +BIDI +GNUTLS +ICU +SYSTEMD

To Reproduce

Steps to reproduce the behavior:

$ jira issue comment add FOOBAR-42 --no-input --template - <<'EOF'
This is a comment.
EOF

Expected behavior
If the COMMENT_BODY were really necessary, then one might expect to see an error message like this:

Error:
  - comment: Comment body can not be empty!

Since COMMENT_BODY is not actually necessary, the jira issue comment add --help message should be changed from this...

$ jira issue comment add --help | head -n4
Add adds comment to an issue.

USAGE
  jira issue comment add ISSUE-KEY COMMENT_BODY [flags]

...to this:

$ jira issue comment add --help | head -n4
Add adds comment to an issue.

USAGE
  jira issue comment add ISSUE-KEY [COMMENT_BODY] [flags]

Screenshots
not applicable

Additional context
not applicable

Assigning issue to self doesn't assign it

Describe the bug

Running the following command doesn't assign the issue to me, instead the user search opens up, in which I'm unfindable as well.

jira issue assign "TICKET-CODE" "$(jira me)"

Please provide following details

  1. JiraCLI Version:
    (Version="0.1.1", GitCommit="6663763b44a2e5d328b551ae7d2f1a37d1e232ae", GoVersion="go1.17.2", BuildDate="2021-11-03"", Compiler="gc", Platform="darwin/amd64")
    
  2. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
    Jira Server v8.20.0
    
  3. What operating system are you using? Also mention version.
    macOS 12.0.1
    
  4. What terminal are you using? Also mention version.
    alacritty 0.9.0 (fed349a)
    

To Reproduce

Steps to reproduce the behavior:

  1. Run jira issue assign "TICKET-CODE" "$(jira me)"
  2. Issue isn't assigned to you, user search is opened up
  3. Probably a separate issue but no names past the initial cropped list are findable

Expected behavior

The issue would be assigned to me.

Additional context

Not that it's relevant here but I'm using the line in the following function:

# Move an issue back to progress
jmbk() {
  jira issue transition "$1" "Back To Progress"
  jira issue assign "$1" "$(jira me)"
}

JIRA_API_TOKEN and Authorization: Bearer

Hi,
my curl works ok with Authorization: Bearer header. Example:
curl -X GET -H "Authorization: Bearer xxx" \ -H "Content-Type: application/json" \ "https://jira.url.com/rest/api/2/user/properties?username=some_user"

But when I do jira init I get 401.

My JIRA_API_TOKEN is stored in .zshrc with:
export JIRA_API_TOKEN=xxx

Unable to generate configuration when jira init.

  1. Version:
    JiraCLI (Version="dev", GitCommit="", GoVersion="go1.17.3", BuildDate="", Compiler="gc", Platform="linux/amd64")
    Atlassian Jira (v8.13.11), on-premise.
    CentOS Linux release 7.8.2003 (Core) , Konsole 2.10.5
    
  2. Steps
     ~/go/bin> jira init
     ? Installation type: Local
     ? Link to Jira server: https://myjira.com/
     ? Login username: larry
     ? Default project: PK
     � Fetching boards for project 'PK'... 
     � Unable to generate configuration: please provide options to select from
    
  3. Debug
    go/bin> curl --request GET \
        --url 'https://myjira.com/rest/agile/1.0/board?projectKey=PK' \
        --user "larry:***"
    
    Jira server return:
    {"maxResults":50,"startAt":0,"total":0,"isLast":true,"values":[]}
    

The message returned by the jira server is expected?
Or is there any suggested way to solve it?
Thanks!

jira sprint list: `--plain` has no effect

Describe the bug
jira sprint list --plain fails to display output in plain mode

Please provide following details

  1. JiraCLI Version:
    $ go install github.com/ankitpokhrel/jira-cli/cmd/jira@9f5b0d005a2bf978d387245f03be560ca71b1154
    $ jira version
    (Version="", GitCommit="", GoVersion="go1.17.3", BuildDate="", Compiler="gc", Platform="linux/amd64")
    
  2. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
    Jira cloud
    
  3. What operating system are you using? Also mention version.
    Distributor ID:	Ubuntu
    Description:	Ubuntu 18.04.6 LTS
    Release:	18.04
    Codename:	bionic
    
  4. What terminal are you using? Also mention version.
    # GNOME Terminal 3.28.2 using VTE 0.52.2 +GNUTLS -PCRE2
    

To Reproduce

Steps to reproduce the behavior:

$ nohup jira sprint list --plain >jira-sprint-list.txt &
[1] 10801
nohup: ignoring input and redirecting stderr to stdout

$ ls jira-sprint-list.txt 
jira-sprint-list.txt
[1]+  Stopped                 nohup jira sprint list --plain > jira-sprint-list.txt

$ awk 1 jira-sprint-list.txt 
⠴ Fetching sprints... 

Expected behavior
jira sprint list --plain prints the list of sprints to standard output.

Screenshots
not applicable

Additional context
none

jira issue edit --status

Please consider opening a discussion in ideas category if applicable. Your feature will be prioritized on based on the number of votes.

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
I would like the ability to edit the status of an issue; e.g.,

jira issue edit FOOBAR-1024 --status "Closed"

Describe alternatives you've considered
I have considered the atlassian web page. The atlassian web page sucks.

Additional context
Not applicable.

fatal error: runtime: out of memory

  1. Version:
    JiraCLI (Version="dev", GitCommit="", GoVersion="go1.17.3", BuildDate="", Compiler="gc", Platform="linux/amd64")
    Atlassian Jira (v8.13.11), on-premise.
    CentOS Linux release 7.8.2003 (Core) , Konsole 2.10.5
    
  2. Steps
     ~/go/bin> jira issue view ISSUE-1
    
  3. Debug log
    fatal error: runtime: out of memory
    
    runtime stack:
    runtime.throw({0xcc40a2, 0x118c00000})
            /home/local/go/src/runtime/panic.go:1198 +0x71
    runtime.sysMap(0xc260c00000, 0x429680, 0x7fff957e1d28)
            /home/local/go/src/runtime/mem_linux.go:169 +0x96
    runtime.(*mheap).grow(0x13a8a20, 0x8c479)
            /home/local/go/src/runtime/mheap.go:1393 +0x225
    runtime.(*mheap).allocSpan(0x13a8a20, 0x8c479, 0x0, 0x1)
            /home/local/go/src/runtime/mheap.go:1179 +0x165
    runtime.(*mheap).alloc.func1()
            /home/local/go/src/runtime/mheap.go:913 +0x69
    runtime.systemstack()
            /home/local/go/src/runtime/asm_amd64.s:383 +0x49
    
    goroutine 1 [running]:
    runtime.systemstack_switch()
            /home/local/go/src/runtime/asm_amd64.s:350 fp=0xc00008d700 sp=0xc00008d6f8 pc=0x461480
    runtime.(*mheap).alloc(0x1188f2000, 0x8c479, 0x4, 0x0)
            /home/local/go/src/runtime/mheap.go:907 +0x73 fp=0xc00008d750 sp=0xc00008d700 pc=0x4259b3
    runtime.(*mcache).allocLarge(0x78137f, 0x1188f2000, 0xaf, 0x1)
            /home/local/go/src/runtime/mcache.go:227 +0x89 fp=0xc00008d7b0 sp=0xc00008d750 pc=0x416629
    runtime.mallocgc(0x1188f2000, 0x0, 0x0)
            /home/local/go/src/runtime/malloc.go:1082 +0x5c5 fp=0xc00008d830 sp=0xc00008d7b0 pc=0x40cba5
    runtime.growslice(0xc0001e30b5, {0xc0c8b80000, 0xc000175000, 0x16}, 0x20)
            /home/local/go/src/runtime/slice.go:261 +0x4ac fp=0xc00008d898 sp=0xc00008d830 pc=0x44a2cc
    strings.(*Builder).WriteString(...)
            /home/local/go/src/strings/builder.go:124
    github.com/ankitpokhrel/jira-cli/pkg/md/jirawiki.secondPass({0xc000175000, 0xc000132200, 0x20})
            /home/local/jira-cli-main/pkg/md/jirawiki/parser.go:130 +0x125 fp=0xc00008d9a0 sp=0xc00008d898 pc=0x7806c5
    github.com/ankitpokhrel/jira-cli/pkg/md/jirawiki.Parse({0xc0001e2a80, 0x904})
            /home/local/jira-cli-main/pkg/md/jirawiki/parser.go:83 +0x10b fp=0xc00008da10 sp=0xc00008d9a0 pc=0x7804eb
    github.com/ankitpokhrel/jira-cli/pkg/md.FromJiraMD(...)
            /home/local/jira-cli-main/pkg/md/md.go:23
    github.com/ankitpokhrel/jira-cli/internal/view.Issue.description({{0xc0000232a0, 0x1e}, 0xc00015a280, {0x0, 0x0, 0x0, {0x0, 0x0, 0x0}}})
            /home/local/jira-cli-main/internal/view/issue.go:214 +0xa5 fp=0xc00008da68 sp=0xc00008da10 pc=0xb27405
    github.com/ankitpokhrel/jira-cli/internal/view.Issue.fragments({{0xc0000232a0, 0x1e}, 0xc00015a280, {0x0, 0x0, 0x0, {0x0, 0x0, 0x0}}})
            /home/local/jira-cli-main/internal/view/issue.go:105 +0x165 fp=0xc00008dbd8 sp=0xc00008da68 pc=0xb25aa5
    github.com/ankitpokhrel/jira-cli/internal/view.Issue.RenderedOut({{0xc0000232a0, 0x1e}, 0xc00015a280, {0x0, 0x0, 0x0, {0x0, 0x0, 0x0}}}, 0xc000165000)
            /home/local/jira-cli-main/internal/view/issue.go:63 +0xce fp=0xc00008dcc0 sp=0xc00008dbd8 pc=0xb24aae
    github.com/ankitpokhrel/jira-cli/internal/view.Issue.Render({{0xc0000232a0, 0x1e}, 0xc00015a280, {0x0, 0x0, 0x0, {0x0, 0x0, 0x0}}})
            /home/local/jira-cli-main/internal/view/issue.go:52 +0xa5 fp=0xc00008dd18 sp=0xc00008dcc0 pc=0xb248e5
    github.com/ankitpokhrel/jira-cli/internal/cmd/issue/view.view(0xc0000bd400, {0xc000036620, 0x1, 0x2})
            /home/local/jira-cli-main/internal/cmd/issue/view/view.go:60 +0x172 fp=0xc00008ddb0 sp=0xc00008dd18 pc=0xb615f2
    github.com/spf13/cobra.(*Command).execute(0xc0000bd400, {0xc000036600, 0x2, 0x2})
            /home/local/jira-cli-main/vendor/github.com/spf13/cobra/command.go:860 +0x5f8 fp=0xc00008de70 sp=0xc00008ddb0 pc=0x586278
    github.com/spf13/cobra.(*Command).ExecuteC(0xc0000bc280)
            /home/local/jira-cli-main/vendor/github.com/spf13/cobra/command.go:974 +0x3bc fp=0xc00008df28 sp=0xc00008de70 pc=0x58697c
    main.main()
            /home/local/jira-cli-main/cmd/jira/main.go:12 +0x1e fp=0xc00008df80 sp=0xc00008df28 pc=0xb6b01e
    runtime.main()
            /home/local/go/src/runtime/proc.go:255 +0x227 fp=0xc00008dfe0 sp=0xc00008df80 pc=0x435a67
    runtime.goexit()
            /home/local/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc00008dfe8 sp=0xc00008dfe0 pc=0x463561
    

Some of tickets can't open by using "view".
I'm not sure what issue will triggered this.
The content looks normal.

Ability to log time to an issue

Could you please also add functionality so time spent can be logged to an issue?

Thanks for putting in the effort to make jira usable ;)

Help text for sprint list defines a static acceptable list of columns that's incorrect

Describe the bug

The help text says the following:
image

However the names aren't accureate to the header names in the output which can be used as valid.

jira sprint list 99 -p DEVOPS --plain --columns TYPE,KEY,STATUS

image

Please provide following details

  1. JiraCLI Version:
    (Version="0.3.0", GitCommit="ea53355d5b72994a5b17a63e6e800ce9d8a23f4e", CommitDate="2022-01-09T19:50:19+00:00", GoVersion="go1.17.5", Compiler="gc", Platform="linux/amd64")
    
  2. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
    Jira cloud
    
  3. What operating system are you using? Also mention version.
    Ubuntu 20.04.2 LTS running in WSL2 on Windows 11 Pro version 10.0.22000
    
  4. What terminal are you using? Also mention version.
    Windows terminal Version 1.11.3471.0
    

Unexpected response '404 Not Found' from jira.

Hey. I am really looking forward to use your program but got stuck on the init phase. Is it because of the oldness of my company's jira version or something else?

  1. JiraCLI Version:
    0.2.0
  2. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
    on-premise 6.2.1
  3. What operating system are you using? Also mention version.
    manjaro kernel version 5.10.79-1
  4. What terminal are you using? Also mention version.
    Konsole (konsole) 21.08.3-1

Steps to reproduce the behavior:

? Installation type: Local
? Link to Jira server: https://jira.company.ru
? Login username: username
? Default project: PROJECT
⠙ Fetching boards for project 'PROJECT'... 
✗ Received unexpected response '404 Not Found' from jira. Please try again.

Possibility to use username/password as ENV variables instead of JIRA_API_TOKEN

Please consider opening a discussion in ideas category if applicable. Your feature will be prioritized on based on the number of votes.

Is your feature request related to a problem? Please describe.
I can't use the jira-cli, I have only a username/password and can't generate an API token myself.

Describe the solution you'd like
The possibility to support a JIRA_USERNAME/JIRA_PASSWORD as ENV variables instead of JIRA_API_TOKEN

Tracking issue for self-hosted support

Ah, I was so excited to be able to escape the horrific Jira UI, but alas I see this project doesn't support self-hosted instances. 😢

Not sure what the API differences are but maybe I can lend a hand.

How about a tracking issue?

Cursor in terminal disappears after tried to search by status incorrectly

Describe the bug

Illustrated on the recording:

Peek 2021-10-15 16-21-cursor

Please provide following details

  1. JiraCLI Version:
    (Version="0.0.0", GitCommit="6c1e78e4a3b57f50ffb3e2ab3c79faaf2117b9db", GoVersion="go1.17", BuildDate="2021-09-05"", Compiler="gc", Platform="linux/amd64")
    
    
  2. Are you using Jira cloud or on-premise jira server?
    Jira cloud
    
  3. What operating system are you using? Also mention version.
    Ubuntu 20.04.3 LTS
    
  4. What terminal are you using? Also mention version.
    GNOME Terminal 3.36.2
    

To Reproduce

Please see the recording above.

Expected behavior

While the syntax I tried to use is clearly incorrect, it is not expected that the cursor disappears after this.

Additional context

Great tool!

Doesn't honor default browser

Describe the bug
My system browser (x-www-browser) is chrome, but opening a issue pops open a firefox window.

Please provide following details

  1. JiraCLI Version:
$ jira version
(Version="0.3.0", GitCommit="ea53355d5b72994a5b17a63e6e800ce9d8a23f4e", CommitDate="2022-01-09T19:50:19+00:00", GoVersion="go1.17.5", Compiler="gc", Platform="linux/amd64")
  1. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
    Please type your answer here. eg: Cloud
  1. What operating system are you using? Also mention version.
    Please type your answer here. Ubuntu 18.04
  1. What terminal are you using? Also mention version.
rxvt-unicode 9.30-2+b1

To Reproduce

Steps to reproduce the behavior:

  1. jira issues list
  2. hit enter on an issue
  3. Pops open a browser that isn't necessarily your default

Expected behavior
Uses default browser

jira issue list: 400 Bad Request

Describe the bug

$ jira issue list
⠦ Fetching issues... 
Error:
  - The value '' does not exist for the field 'project'.

jira: Received unexpected response '400 Bad Request'.
Please check the parameters you supplied and try again.

Please provide following details

  1. JiraCLI Version:
    $ go install github.com/ankitpokhrel/jira-cli/cmd/[email protected]
    $ jira version 
    (Version="dev", GitCommit="", GoVersion="go1.17.3", BuildDate="", Compiler="gc", Platform="linux/amd64")
    
  2. Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
    cloud
    
  3. What operating system are you using? Also mention version.
    Ubuntu 18.04
    
  4. What terminal are you using? Also mention version.
    $ gnome-terminal --version
    # GNOME Terminal 3.28.2 using VTE 0.52.2 +GNUTLS -PCRE2
    

To Reproduce

Steps to reproduce the behavior:

$ go install github.com/ankitpokhrel/jira-cli/cmd/[email protected] && jira issue list
⠼ Fetching issues... 
Error:
  - The value '' does not exist for the field 'project'.

jira: Received unexpected response '400 Bad Request'.
Please check the parameters you supplied and try again.

Expected behavior
See the list of issues.

Screenshots
Not applicable.

Additional context
Not applicable.

newline not parsing in markdown

Description

When writing the body of a ticket I have noticed that newlines do not parse as such. In particular

  1. carriage return (just leaving a physical new line between paragraphs) does not insert a new line (the text is still attached in-line)
  2. \n or \r characters are interpreted and inserted verbatim

Terminal

I am using neovim on iterm2 - if that matters - to edit the body text of the tickets.

Has anybody met the same problem or do newlines just work fine (and for some reasons I am unable to have them work)?

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.