jira-cmd: jira ls - no issues => implement better error handling

Just installed jira cmd and jira ls gives me no issues. I’m using jira cloud (not hosted jira). I guess that something is happening under the hood but no error is thrown so I can tell what is the cause.

jira -V
v0.5.4

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 26 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Some organizations disable Basic auth entirely - regardless if you use a password or an API token - and there the solution is to use the HTTP header Authorization: Bearer <apitoken>.

I used an ugly workaround to find/replace all “Basic” with “Bearer”, and made sure config.auth.token was the API token generated by JIRA.

Looks like some mixup on documenting the solution when using a token instead of a password. The issued referred to just above (#93) points to a commit that has nothing to do with documenting the solution here.

So to save some other folks time in figuring it out, here is what should be documented from my experiments ultimately leading to a successful connection for an OAuth-based login.

  1. Navigate to your Atlassian token management page: https://id.atlassian.com/manage-profile/security/api-tokens

  2. Create a token; call it whatever you want; but you should end up something like this: image

  3. Copy that token.

  4. If you have already tried configuring jira-cli delete your ~/.jira/config.json file.

  5. Run jira to start the configuration again.

  6. Go through the dialog, but instead of entering a password, enter the token from line (3).

% jira
Jira URL: https://<your-org-here>.atlassian.net/
Username: <your-org-email>
Password: <your-token>
Information stored!
  1. Confirm your information is stored correctly in the configuration:
% grep token ~/.jira/config.json | awk -F \" '{print $4}' | base64 -d

The output should be

<your-org-email>:<your-token>
  1. Test your connection:
% jira ls

sure, let me share a branch with you which can enable more verbose logs. give me 5 mins.