Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira-CLI init: "✗ Received unexpected response '403 Forbidden' from jira." for Jira Cloud on Windows

Zsolt Esse July 19, 2023

Hi All,

I keep getting this error when trying to init Jira command-line interface by jira-cli :
"✗ Received unexpected response '403 Forbidden' from jira."

I created my API token at https://id.atlassian.com/manage-profile/security/api-tokens
Then I saved this to an environment variable (I tried both user and system level). I also created a second variable called JIRA_AUTH_TYPE, and put "bearer" string into it, indicating it is not basic authentication, altough  we are using Jira Cloud, so I shouldn't need this.
In addion I save these values in variables in powershell's $profile file, to make sure these variables are "visible" for powershell/ Jira CLI.

Then I run ```jira``` init (jira.exe from bin of jira_cli. )
I selected Cloud option, then give our server link ( https://domain-of-my-company.atlassian.net) and my email address for jira. Still I get this error message.

Also I tried git bash, and I tried to save my API key to $HOME/.bashrc, but the same thing happened.

What am I missing?
Thank you!

2 answers

1 vote
Naveen Kumar_Appfire
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 20, 2023

Hi @Zsolt Esse

Welcome to the Atlassian community,

Could you please confirm whether you using the app Jira Command Line Interface (CLI) app?

Zsolt Esse September 20, 2023


Hi,
I don't think so. It's https://github.com/ankitpokhrel/jira-cli

0 votes
Brad McCormick
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 18, 2023

Wanted to be sure you had seen this:

https://github.com/ankitpokhrel/jira-cli/issues/401

It didn't help me, but maybe it'll help you!  And if it does, please post back here and let us know how you solved it.

Zsolt Esse September 20, 2023

Hi Brad!

I tried this curl (modified to use our project, of course):

curl --request GET \
  -H "Authorization: Bearer $JIRA_API_TOKEN" \
  --url 'https://<host>.atlassian.net/rest/agile/1.0/board?projectKeyOrId=IT'

But I got this error:


"error": "Failed to parse Connect Session Auth Token"}


When I tried this curl:

curl --request GET \
  --user "<email>:$JIRA_API_TOKEN" \
  --url 'https://<host>.atlassian.net/rest/agile/1.0/board?projectKeyOrId=IT'

 

Then I got this message:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>401</status-code><message>Client must be authenticated to access this resource.</message></status>


I didn't find the "product" page jonasrathgeber is talking about, either.  

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events