I am working on Integrating Github Actions and Xray Jira. Github Actions workflow is triggered from Xray Jira execution using Jira automation.
Created Xray JSON report (data.json)
Command used for importing Xray Json report -
curl -H "Content-Type: application/json" -X POST -H "Authorization: Bearer $token" --data @"data.json" https://xray.cloud.getxray.app/api/v2/import/execution
Output -
{
"id": "10515",
"key": "xyz-244",
"self": "https://xyz.atlassian.net/rest/api/2/issue/10515"
}
When verified -> only summary and description is updated but not the test results.
cat data.json
{
"testExecutionKey": "XYZ-244",
"info": {
"summary": "Execution of automated tests for release",
"description": "This execution is automatically created when importing execution results from an external source",
"startDate": "2025-01-07T11:58:48Z",
"finishDate": "2025-01-07T11:58:48Z"
},
"tests": [
{
"testKey": "XYZ-236",
"start": "2025-01-07T11:58:48Z",
"finish": "2025-01-07T11:58:48Z",
"comment": "Successful execution",
"status": "PASS"
},
{
"testKey": "XYZ-231",
"start": "2025-01-07T11:58:48Z",
"finish": "2025-01-07T11:58:48Z",
"comment": "Successful execution",
"status": "PASS"
}
]
}
The Xray JSON schema for Xray on Jira cloud is slightly different from Xray on Jira datacenter.
In this case, the "status" values should be PASSED or FAILED (and not PASS or FAIL). That should be enough to solve your issue.