Forums

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

I get JWT error thro Xray Cloud end point

Ginett Rosales
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!
June 14, 2021

I try to import the results from cypress to my Jira board but I get an authentication error.

I already created the token on Jira but this is the error: 

{"error":"Invalid JWT: JsonWebTokenError: jwt malformed"}

This is the input:

curl -H "Content-Type: text/xml" -X POST -H "Authorization: Bearer $token" --data @"results/test-results.xml" https://xray.cloud.xpand-it.com/api/v1/import/execution/junit?projectKey=QA

Before this I authenticate in Xpand it

curl -H "Content-Type: application/json" -X POST --data '{ "client_id": "","client_secret": "" }' https://xray.cloud.xpand-it.com/api/v1/authenticate

Do I have to do some additional on Jira?

3 answers

0 votes
Rogério Paiva - Xray Xporter
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.
June 25, 2021

Hi @Ginett Rosales 

Yes, as @cristiano.cunha said, that is usually an issue with the token. Like not being correctly stored by API client tool or something similar.

Kind regards,
Rogério Paiva [Xray Support Team]

0 votes
cristiano.cunha June 15, 2021

Hi,

As you can see Xray documentation is divided between Server/DC and Cloud, and some methods/arguments may differ depending on which one you are using (https://docs.getxray.app/site/xray).

 

Assuming you are using the correct one, please make sure the token returned is used without the quotation marks (") and without any strange character in it.

0 votes
Hilda June 15, 2021

Hi Ginett,

I haven't really dabbled around with Xray API, but I found this article that I think may be helpful to you.

From the document, I can that you can use the query below to import the report to Xray using the API query below: 

curl -H "Content-Type: multipart/form-data" -u emailaddress:apitoken -F "file=@results/test-results.xml" http://jiraURL/rest/raven/1.0/import/execution/junit?projectKey=CALC

 With that said, you can confirm the correct API query from the Xray support team using the link below:

Regards,

Hilda

Suggest an answer

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

Atlassian Community Events