jira-cli: jira init - 401 Unauthorized
Describe the bug
jira init
failing with 401 Unauthorized response. but worked with curl requests using the same API token.
Please provide following details
- JiraCLI Version:
(Version="v1.1.1-0.20220814163226-d993757c939c", GitCommit="", CommitDate="", GoVersion="go1.19", Compiler="gc", Platform="linux/amd64")
- Are you using Jira cloud or on-premise jira server? Also mention the version for on-premise installation.
Cloud
- What operating system are you using? Also mention version.
Void Linux
- What terminal are you using? Also mention version.
foot
To Reproduce
Steps to reproduce the behavior:
- jira init
Expected behavior
should create config file. Screenshots
Additional context
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (6 by maintainers)
great. finally this worked for me. thanks @ankitpokhrel
I can confirm this issue on Ubuntu 20.04, supplying the api token inline works; but setting the token via
export
orbashrc
does not.Thanks. But I always use
export
in my env files. @jaerveiHey @akhiljalagam and @viditsi1 ! I had a similar problem but I found out that I made mistake while setting environmental variable. I tried first to add just
JIRA_API_ROKEN="xxxxxxxxxxxxxxxxxxxxx"
to my.bashrc
. My--debug init
gave similar result than yours. Then after 2 min Google I understood to add commandexport
to the beginning of line. After that I ran commandsource .bashrc
, and voilá, it’s working! So make sure that your.bashrc
file has a line likeexport JIRA_API_ROKEN="xxxxxxxxxxxxxxxxxxxxx"
. and then run commandsource .bashrc
. I hope it will work! 😃