Forums

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

X-ray Jira , Import to jira , invalid json

Saar levi
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!
April 14, 2022

Hey Community , 

I am trying to send back to my Test , a sample Test-Execution results ,

I have this command which i copied and altered from the guide:

curl -v -H "Content-Type: application/json" -X POST -H "Authorization: Bearer ${token}" --data @"/home/arbe/temp/xray/data2.json" "https://xray.cloud.getxray.app/api/v2/import/execution/"

the output (the bottom line not all the verbose output ) :

* Connection #0 to host xray.cloud.getxray.app left intact
{"error":"Result is not valid Xray Format"}

( The Token passed successfully ) 

 

the Json : 

{
"info" : {
"summary" : "Test X-ray",
"description" : "Test X-ray",
"version" : "v1.0",
"user" : "########(privacy reasons)",
"revision" : "1",
"startDate" : "2022-04-22T16:30:35+01:00",
"finishDate" : "2022-04-22T16:53:00+01:00",
"testPlanKey" : "ARBE-264",
"testEnvironments": ["Windows", "Linux"]
},
"tests" : [
{
"testKey" : "ARBE-277",
"start" : "2022-04-22T16:30:35+01:00",
"finish" : "2022-04-22T16:53:00+01:00",
"actualResult" : "Successful execution",
"status" : "PASSED"
}

]
}

 

I just want to see that this function works , so i can implement  a gitlab repo with the code to run the test , and upload back a TE with a pass/fail 

 

Thanks 

 

1 answer

0 votes
Stefan Salzl
Community Champion
April 14, 2022

Hi @Saar levi - welcome to the Atlassian Community,

Which test framework are you using or how is the JSON generated??

Did you check the documentation regarding this topic:
https://docs.getxray.app/plugins/servlet/mobile?contentId=62271187#ImportExecutionResults-XrayJSONformat

In general this should work but there is a specific JSON format that is accepted by XRAY. (personally I used the xml import —> sub test execution is created from github action and automatically filled with test results, both via API).

 

Best
Stefan

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events