Imports CI test results into Xray for Jira - authenticates via the `client_id` + `client_secret` → JWT exchange (Cloud) or PAT / Basic (Server), posts to the format-specific `/api/v2/import/execution/*` endpoint (`/junit` for JUnit XML, `/cucumber` for Cucumber JSON, `/nunit` / `/testng` / `/robot` for the others), and maps automated results to existing Xray Test issues via the `xray-junit-extensions` `@XrayTest(key="...")` annotation. Use when the team uses the Xray Jira app to manage Test, Test Set, and Test Execution issue types and CI must keep those execution issues in sync; for the other Jira TCM app use zephyr-integration (Zephyr Scale), for standalone non-Jira TestRail use testrail-integration, and for hosted cross-run flakiness analytics rather than TCM sync use currents-integration.
75
94%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Deep reference for the xray-integration SKILL.md. Consult for the end-to-end GitHub Actions workflow (JWT fetch + import) and the official Playwright reporter that lets non-JVM teams emit Xray-compatible JUnit XML.
# .github/workflows/xray-sync.yml
- name: Run tests with Xray-aware JUnit reporter
run: ./mvnw -B verify
# Produces target/xray-reports/TEST-results.xml
- name: Get Xray JWT
id: xray_auth
env:
XRAY_CLIENT_ID: ${{ secrets.XRAY_CLIENT_ID }}
XRAY_CLIENT_SECRET: ${{ secrets.XRAY_CLIENT_SECRET }}
run: |
JWT=$(curl -s -X POST 'https://xray.cloud.getxray.app/api/v2/authenticate' \
-H 'Content-Type: application/json' \
-d '{"client_id":"'"$XRAY_CLIENT_ID"'","client_secret":"'"$XRAY_CLIENT_SECRET"'"}' \
| tr -d '"')
echo "::add-mask::$JWT"
echo "jwt=$JWT" >> "$GITHUB_OUTPUT"
- name: Import to Xray
if: always()
run: |
curl -X POST 'https://xray.cloud.getxray.app/api/v2/import/execution/junit?projectKey=CALC' \
-H "Authorization: Bearer ${{ steps.xray_auth.outputs.jwt }}" \
-H 'Content-Type: application/xml' \
--data-binary @target/xray-reports/TEST-results.xmlThe projectKey requirement is covered in SKILL Step 6, JWT masking and
the 24h refresh in Step 1; both apply unchanged to the YAML above.
Per the Xray-App GitHub org, the playwright-junit-reporter project
ships a Playwright reporter that emits Xray-compatible JUnit XML. JavaScript
teams use:
// playwright.config.ts
reporter: [
['list'],
['@xray-app/playwright-junit-reporter', {
outputFile: 'target/xray-reports/results.xml',
}],
],Then the same import endpoint (End-to-end CI shape, above) consumes the output.