Giter Club home page Giter Club logo

jira-cli's Introduction

stargazers over time

JiraCLI

Build GO Report-card Software License Financial Contributors

Feature-rich Interactive Jira Command Line

JiraCLI Demo

Financial support from private and corporate sponsors ensures the tool's continued development.
Please consider sponsoring the project if you or your company rely on JiraCLI.


jira-cli open collective badge

Supporters

Atlassian Logo
JetBrains Logo CaptionAI Logo

JiraCLI is an interactive command line tool for Atlassian Jira that will help you avoid Jira UI to some extent. This tool may not be able to do everything, but it has all the essential features required to improve your day-to-day workflow with Jira.

The tool started with the idea of making issue search and navigation as straightforward as possible. However, with the help of outstanding supporters like you, we evolved, and the tool now includes all necessary features like issue creation, cloning, linking, ticket transition, and much more.

This tool is heavily inspired by the GitHub CLI

Supported platforms

Note that some features might work slightly differently in cloud installation versus on-premise installation due to the nature of the data. Yet, we've attempted to make the experience as similar as possible.

Platform LinuxmacOSFreeBSDNetBSDWindows
Jira Jira CloudJira Server

Installation

jira-cli is available as a downloadable packaged binary for Linux, macOS, and Windows from the releases page.

You can use Docker to quickly try out jira-cli.

docker run -it --rm ghcr.io/ankitpokhrel/jira-cli:latest

Follow the installation guide for other installation methods like Homebrew, Nix, etc.

Getting started

Cloud server

  1. Get a Jira API token and export it to your shell as a JIRA_API_TOKEN variable. Add it to your shell configuration file, for instance, $HOME/.bashrc, so that the variable is always available. Alternatively, you can also use .netrc file or keychain to set the token. Learn more here.
  2. Run jira init, select installation type as Cloud, and provide required details to generate a config file required for the tool.

On-premise installation

  1. Export required environment variables:

    • If you are using basic auth, export the password you use to login to Jira as a JIRA_API_TOKEN variable.
    • If you are using personal access token (PAT), get the token from your jira profile and export it as a JIRA_API_TOKEN variable. In addition to this, set JIRA_AUTH_TYPE env to bearer.
    • Add these ENVs to your shell configuration file, for instance, $HOME/.bashrc, so that they are always available.
    • Alternatively, you can also use .netrc file or keychain to set the token. Learn more here.
  2. Run jira init, select installation type as Local, and provide the required details to generate a config file required for the tool.

    • The most common auth type for on-premise installation is basic. If you are using your jira login credentials (username and password), select the basic auth type.
    • If you want to use mtls (client certificates), select auth type mtls and provide the CA Cert, client Key, and client cert.

    Note: If your on-premise Jira installation is using a language other than English, then the issue/epic creation may not work because the older version of Jira API doesn't return the untranslated name for issuetypes. In that case, you will have to fill in epic.name, epic.link and issue.types.*.handle fields manually in the generated config to get the expected behavior.

See FAQs for frequently asked questions.

Authentication types

The tool supports basic, bearer (Personal Access Token), and mtls (Client Certificates) authentication types. Basic auth is used by default.

  • If you want to use PAT, you need to set JIRA_AUTH_TYPE as bearer.
  • If you want to use mtls run jira init. Select installation type Local, and then select authentication type as mtls.

Shell completion

Check jira completion --help for more info on setting up a bash/zsh shell completion.

Usage

The tool currently comes with an issue, epic, and sprint explorer. The flags are POSIX-compliant. You can combine available flags in any order to create a unique query. For example, the command below will give you high priority issues created this month with status To Do that are assigned to you and has the label backend.

jira issue list -yHigh -s"To Do" --created month -lbackend -a$(jira me)

Navigation

The lists are displayed in an interactive UI by default.

  • Use arrow keys or j, k, h, l characters to navigate through the list.
  • Use g and G to quickly navigate to the top and bottom respectively.
  • Use CTRL + f to scroll through a page downwards direction.
  • Use CTRL + b to scroll through a page in upwards direction.
  • Press v to view selected issue details.
  • Press m to transition the selected issue.
  • Press CTRL + r or F5 to refresh the issues list.
  • Hit ENTER to open the selected issue in the browser.
  • Press c to copy issue URL to the system clipboard. This requires xclip / xsel in linux.
  • Press CTRL + k to copy issue key to the system clipboard.
  • In an explorer view, press w or TAB to toggle focus between the sidebar and the contents screen.
  • Press q / ESC / CTRL + c to quit.
  • Press ? to open the help window.

Resources

Commands

Issue

Issues are displayed in an interactive table view by default. You can output the results in a plain view using the --plain flag.

List

The list command lets you search and navigate the issues. The issues are sorted by created field in descending order by default.

# List recent issues
$ jira issue list

# List issues created in last 7 days
$ jira issue list --created -7d

# List issues in status "To Do"
$ jira issue list -s"To Do"

# List recent issues in plain mode
$ jira issue list --plain

# List issue in the same order as you see in the UI
$ jira issue list --order-by rank --reverse

# You can execute raw JQL within a given project context using `--jql/-q` option.
# For instance, the following command will list issues in the current project whose
# summary has a word cli.
$ jira issue list -q "summary ~ cli"

Check some more examples/use-cases below.

List issues that I am watching
jira issue list -w
List issues assigned to me
jira issue list -a$(jira me)
List issues assigned to a user and are reported by another user
jira issue list -a"User A" -r"User B"
List issues assigned to me, is of high priority and is open
jira issue list -a$(jira me) -yHigh -sopen
List issues assigned to no one and are created this week
jira issue list -ax --created week
List issues with resolution won't do
jira issue list -R"Won't do"
List issues whose status is not done and is created before 6 months and is assigned to someone
# Tilde (~) acts as a not operator
jira issue list -s~Done --created-before -24w -a~x
List issues created within an hour and updated in the last 30 minutes ⏱️
jira issue list --created -1h --updated -30m
Give me issues that are of high priority, are in progress, were created this month, and have given labels 🔥
jira issue list -yHigh -s"In Progress" --created month -lbackend -l"high-prio"
Wait, what was that ticket I opened earlier today? 😫
jira issue list --history
What was the first issue I ever reported on the current board? 🤔
jira issue list -r$(jira me) --reverse
What was the first bug I ever fixed in the current board? 🪲
jira issue list -a$(jira me) -tBug sDone -rFixed --reverse
What issues did I report this week? 🤷‍♂️
jira issue list -r$(jira me) --created week
Am I watching any tickets in project XYZ? 🧐
jira issue list -w -pXYZ

Create

The create command lets you create an issue.

# Create an issue using an interactive prompt
$ jira issue create

# Pass required parameters and use --no-input option to skip prompt
$ jira issue create -tBug -s"New Bug" -yHigh -lbug -lurgent -b"Bug description" --fix-version v2.0 --no-input

To attach epic to an issue on creation, you can use -P/--parent field. We call it parent because the semantics of epic has been changed in next-gen project.

# Create an issue of type Story and attach it to epic with key EPIC-42
$  jira issue create -tStory -s"Epic during creation" -PEPIC-42

Create an issue

You can use a --custom flag to set custom fields while creating the issue. See this post for more details.

The command supports both Github-flavored and Jira-flavored markdown for writing description. You can load pre-defined templates using --template flag.

# Load description from template file
$ jira issue create --template /path/to/template.tmpl

# Get description from standard input
$ jira issue create --template -

# Or, use pipe to read input directly from standard input
$ echo "Description from stdin" | jira issue create -s"Summary" -tTask

Markdown render preview

The preview above shows markdown template passed in Jira CLI and how it is rendered in the Jira UI.

Edit

The edit command lets you edit an issue.

$ jira issue edit ISSUE-1

# Edit issue in the configured project
$ jira issue edit ISSUE-1 -s"New Bug" -yHigh -lbug -lurgent -CBackend -b"Bug description"

# Use --no-input option to disable interactive prompt
$ jira issue edit ISSUE-1 -s"New updated summary" --no-input

# Use minus (-) to remove label, component or fixVersion
# For instance, to edit issue to 
#   - remove label p2, component FE, fixVersion v1.0 
#   - add label p1, component BE, fixVersion v2.0
$ jira issue edit ISSUE-1 --label -p2 --label p1 --component -FE --component BE --fix-version -v1.0 --fix-version v2.0

Assign

The assign command lets you assign a user to an issue.

# Assign user to an issue using an interactive prompt
$ jira issue assign

# Pass required parameters to skip prompt
$ jira issue assign ISSUE-1 "Jon Doe"

# Assign to self
$ jira issue assign ISSUE-1 $(jira me)

# Will prompt for selection if keyword suffix returns multiple entries
$ jira issue assign ISSUE-1 suffix

# Assign to default assignee
$ jira issue assign ISSUE-1 default

# Unassign
$ jira issue assign ISSUE-1 x

Assign issue to a user

Move/Transition

The move command lets you transition an issue from one state to another.

# Move an issue using an interactive prompt
$ jira issue move

# Pass required parameters to skip prompt
$ jira issue move ISSUE-1 "In Progress"

Move an issue

If your workflow allows to add comment, resolution or assignee while moving an issue, you can do so as shown below. See this documentation on how to setup your workflow to allow these fields.

# Move an issue and add comment
$ jira issue move ISSUE-1 "In Progress" --comment "Started working on it"

# Set resolution to fixed and assign to self while moving the issue
$ jira issue move ISSUE-1 Done -RFixed -a$(jira me)

To transition the selected issue from the TUI, press m.

View

The view command lets you see issue details in a terminal. Atlassian document is roughly converted to a markdown and is nicely displayed in the terminal.

The command uses less as a pager by default. To set your own pager, see #569.

$ jira issue view ISSUE-1

View an issue

The view screen will display linked issues and the latest comment after the description. Note that the displayed comment may not be the latest one if you for some reason have more than 5k comments in a ticket.

# Show 5 recent comments when viewing the issue
$ jira issue view ISSUE-1 --comments 5

Link

The link command lets you link two issues.

# Link an issue using an interactive prompt
$ jira issue link

# Pass required parameters to skip prompt
$ jira issue link ISSUE-1 ISSUE-2 Blocks
Remote

The remote command lets you add a remote web link to an issue.

# Adds a remote web link using an interactive prompt
$ jira issue link remote

# Pass required parameters to skip prompt
$ jira issue link remote ISSUE-1 https://example.com "Example text"

Unlink

The unlink command lets you unlink two linked issues.

# Unlink issues using interactive prompt
$ jira issue unlink

# Pass required parameters to skip prompt
$ jira issue unlink ISSUE-1 ISSUE-2

Clone

The clone command lets you clone an issue. You can update fields like summary, priority, assignee, labels, and components when cloning the issue. The command also allows you to replace a part of the string (case-sensitive) in summary and description using --replace/-H option.

# Clone an issue
$ jira issue clone ISSUE-1

# Clone issue and modify the summary, priority and assignee
$ jira issue clone ISSUE-1 -s"Modified summary" -yHigh -a$(jira me)

# Clone issue and replace text from summary and description
$ jira issue clone ISSUE-1 -H"find me:replace with me"

Delete

The delete command lets you delete an issue.

# Delete an issue using an interactive prompt
$ jira issue delete

# Pass required parameters to skip prompt
$ jira issue delete ISSUE-1

# Delete task along with all of its subtasks
$ jira issue delete ISSUE-1 --cascade

Comment

The comment command provides a list of sub-commands to manage issue comments.

Add

The add command lets you add a comment to an issue. The command supports both Github-flavored and Jira-flavored markdown for writing comment. You can load pre-defined templates using --template flag.

# Add a comment using an interactive prompt
$ jira issue comment add

# Pass required parameters to skip prompt
$ jira issue comment add ISSUE-1 "My comment body"

# Load comment from template file
$ jira issue comment add ISSUE-1 --template /path/to/template.tmpl

# Get comment from standard input
$ jira issue comment add ISSUE-1 --template -

# Or, use pipe to read input directly from standard input
$ echo "Comment from stdin" | jira issue comment add ISSUE-1

Note: For the comment body, the positional argument always takes precedence over the --template flag if both of them are passed. In the example below, the body will be picked from positional argument instead of the template.

jira issue comment add ISSUE-42 "comment body positional" --template - <<'EOF'
comment body template
EOF

Worklog

The worklog command provides a list of sub-commands to manage issue worklog (timelog).

Add

The add command lets you add a worklog to an issue. The command supports markdown for worklog comments.

# Add a worklog using an interactive prompt
$ jira issue worklog add

# Pass required parameters and use --no-input to skip prompt
$ jira issue worklog add ISSUE-1 "2d 3h 30m" --no-input

# You can add a comment using --comment flag when adding a worklog
$ jira issue worklog add ISSUE-1 "10m" --comment "This is a comment" --no-input

Epic

Epics are displayed in an explorer view by default. You can output the results in a table view using the --table flag. When viewing epic issues, you can use all filters available for the issue command.

See usage to learn more about UI interaction.

List

You can use all flags supported by issue list command here except for the issue type.

# List epics
$ jira epic list

# List epics in a table view
$ jira epic list --table

# List epics reported by me and are open
$ jira epic list -r$(jira me) -sOpen

# List issues in an epic
$ jira epic list KEY-1

# List all issue in an epic KEY-1 that is unassigned and has a high priority
$ jira epic list KEY-1 -ax -yHigh

# List high priority epics
$ jira epic list KEY-1 -yHigh

# List epic issues order by the rank in ASC order
$ jira epic list KEY-1 --order-by rank --reverse

Create

Creating an epic is the same as creating the issue except you also need to provide an epic name.

# Create an issue using an interactive prompt
$ jira epic create

# Pass required parameters to skip prompt or use --no-input flag to skip prompt for non-mandatory params
$ jira epic create -n"Epic epic" -s"Everything" -yHigh -lbug -lurgent -b"Epic description"

Add

The add command allows you to add issues to the epic. You can add up to 50 issues to the epic at once.

# Add issues to the epic using an interactive prompt
$ jira epic add

# Pass required parameters to skip prompt
$ jira epic add EPIC-KEY ISSUE-1 ISSUE-2

Remove

The remove command allows you to remove issues from the epic. You can remove up to 50 issues from the epic at once.

# Remove issues to the epic using an interactive prompt
$ jira epic remove

# Pass required parameters to skip prompt
$ jira epic remove ISSUE-1 ISSUE-2

Sprint

Sprints are displayed in an explorer view by default. You can output the results in a table view using the --table flag. When viewing sprint issues, you can use all filters available for the issue command. The tool only shows 25 recent sprints.

See usage to learn more about UI interaction.

List

You can use all flags supported by issue list command to filter issues in the sprint.

# List sprints in an explorer view
$ jira sprint list

# List sprints in a table view
$ jira sprint list --table

# List issues in the current active sprint
$ jira sprint list --current

# List issues in the current active sprint that are assigned to me
$ jira sprint list --current -a$(jira me)

# List issues in the previous sprint
$ jira sprint list --prev

# List issues in next planned sprint
$ jira sprint list --next

# List future and active sprints
$ jira sprint list --state future,active

# List issues in a particular sprint. You can use all flags supported by issue list command here.
# To get sprint id use `jira sprint list` or `jira sprint list --table`
$ jira sprint list SPRINT_ID

# List high priority issues in a sprint are assigned to me
$ jira sprint list SPRINT_ID -yHigh -a$(jira me)

# List sprint issues order by the rank in ASC order
$ jira sprint list SPRINT_ID --order-by rank --reverse

Add

The add command allows you to add issues to the sprint. You can add up to 50 issues to the sprint at once.

# Add issues to the sprint using interactive prompt
$ jira sprint add

# Pass required parameters to skip prompt
$ jira sprint add SPRINT_ID ISSUE-1 ISSUE-2

Other commands

Navigate to the project
jira open
Navigate to the issue
jira open KEY-1
List all projects you have access to
jira project list
List all boards in a project
jira board list

Scripts

Often times, you may want to use the output of the command to do something cool. However, the default interactive UI might not allow you to do that. The tool comes with the --plain flag that displays results in a simple layout that can then be manipulated from the shell script.

Some example scripts are listed below.

Tickets created per day this month
#!/usr/bin/env bash

tickets=$(jira issue list --created month --plain --columns created --no-headers | awk '{print $2}' | awk -F'-' '{print $3}' | sort -n | uniq -c)

echo "${tickets}" | while IFS=$'\t' read -r line; do
  day=$(echo "${line}" | awk '{print $2}')
  count=$(echo "${line}" | awk '{print $1}')

  printf "Day #%s: %s\n" "${day}" "${count}"
done

# Output
Day #01: 19
Day #02: 10
Day #03: 21
...
Number of tickets per sprint
#!/usr/bin/env bash

sprints=$(jira sprint list --table --plain --columns id,name --no-headers)

echo "${sprints}" | while IFS=$'\t' read -r id name; do
  count=$(jira sprint list "${id}" --plain --no-headers 2>/dev/null | wc -l)

  printf "%10s: %3d\n" "${name}" $((count))
done

# Output
Sprint 3:   55
Sprint 2:   40
Sprint 1:   30
...
Number of unique assignee per sprint
#!/usr/bin/env bash

sprints=$(jira sprint list --table --plain --columns id,name --no-headers)

echo "${sprints}" | while IFS=$'\t' read -r id name; do
  count=$(jira sprint list "${id}" --plain --columns assignee --no-headers 2>/dev/null | awk '{print $2}' | awk NF | sort -n | uniq | wc -l)

  printf "%10s: %3d\n" "${name}" $((count))
done

# Output
Sprint 3:   5
Sprint 2:   4
Sprint 1:   3

Known Issues

  1. Not all Atlassian nodes are translated properly at the moment which can cause formatting issues sometimes.

Feature requests

Please open a discussion in ideas category for the proposed feature.

How these requests are usually prioritized?
  • The feature that is straightforward to implement, doesn't require too much mental power, and can be done even I am lazy will be picked first.
  • If the feature is something that I am missing in my day-to-day work, it might be done first.
  • Rest of the features will be picked based on the number of votes on the particular feature.

Development

  1. Clone the repo.

    git clone [email protected]:ankitpokhrel/jira-cli.git
  2. Optional: If you want to run a Jira instance locally, you can use the following make recipe. The trial license key can be generated from the "Licenses" section in the atlassian admin.

    make jira.server
  3. Make changes, build the binary, and test your changes.

    make deps install
  4. Run CI steps locally before submitting a PR.

    make ci

Support the project

Your suggestions and feedbacks are highly appreciated. Please feel free to start a discussion or create an issue to share your experience with the tool or to discuss a feature/issue.

If you think this tool is useful, saves you a lot of work, and lets you sleep much better, then consider supporting the project by any of the following means:


Made with 💚

jira-cli's People

Contributors

adolsalamanca avatar alkuzad avatar ankitpokhrel avatar beatbrot avatar boyvanamstel avatar bryanasdev000 avatar damianoneill avatar danmichaelo avatar dannyjjk avatar danobi avatar dbirks avatar dependabot[bot] avatar drudgerajen avatar elementalwarrior avatar erpel avatar fraggerfox avatar hamzasayadi avatar kmdpl avatar markhatch avatar martinpovolny avatar mpalahuta avatar oveaurs avatar pbnj avatar peterwwillis avatar realtime-neil avatar samundra avatar stavares843 avatar stchar avatar sushilkg avatar szemek 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jira-cli's Issues

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.

`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

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)"
}

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:

`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.

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

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

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?

✗ 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

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.

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!

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

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.

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.

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

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 ;)

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)?

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!

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.

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)?

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.

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

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.

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?

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.

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.

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.)

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?

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!

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,

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.

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.

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

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.

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

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
    

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

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

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

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)?

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.