Skip to main content

xRay Integration

xRay is Jira's test management add-on. RoostGPT integrates with xRay by generating Gherkin .feature files that can be imported directly as xRay Tests, maintaining full traceability from Jira stories to executable tests.

How It Works

  1. RoostGPT generates a Gherkin feature file during the Functional Test phase (from a Jira user story)
  2. You import the .feature file into xRay — this creates xRay Test entities automatically
  3. xRay links the tests back to the originating Jira story, giving you full requirement-to-test traceability
  4. Run the tests in xRay using your CI/CD pipeline or manually, and view results in Jira

Step 1: Generate a Gherkin Feature File

In RoostGPT, run a Functional Test generation against a Jira ticket. This produces:

functional_tests/
├── PROJ-1234_test_scenarios.md ← test scenarios
├── PROJ-1234.feature ← Gherkin feature file ← upload this to xRay
└── PROJ-1234.yaml ← API spec

See Functional Test Generation for the full generation workflow.

Step 2: Import into xRay

Via Jira UI

  1. In Jira, navigate to the xRay section in the left sidebar
  2. Go to Tests → Import
  3. Select Cucumber as the import type
  4. Upload your .feature file
  5. xRay creates a Test entity for each Scenario or Scenario Outline

Via xRay REST API

curl -X POST \
"https://yourcompany.atlassian.net/rest/raven/1.0/import/feature" \
-H "Authorization: Bearer YOUR_XRAY_TOKEN" \
-F "file=@PROJ-1234.feature"

Via xRay Cloud API

curl -X POST \
"https://xray.cloud.getxray.app/api/v1/import/feature" \
-H "Authorization: Bearer YOUR_XRAY_CLOUD_TOKEN" \
-F "file=@PROJ-1234.feature"

After import, xRay will prompt you to associate the imported Tests with a Jira requirement (User Story):

  1. Open the created xRay Test
  2. Click "Link" → select the original Jira story (e.g., PROJ-1234)
  3. The traceability matrix now shows: Story → Feature → Scenario → Test Execution

Step 4: Execute Tests

Run your integration tests against the xRay-imported scenarios using your preferred CI/CD tool, then publish results back to xRay:

# Example: publish Cucumber JSON results to xRay
curl -X POST \
"https://yourcompany.atlassian.net/rest/raven/1.0/import/execution/cucumber" \
-H "Authorization: Bearer YOUR_XRAY_TOKEN" \
-H "Content-Type: application/json" \
-d @cucumber-results.json

Requirements

  • Jira with xRay add-on installed (Server, Data Center, or Cloud)
  • RoostGPT Functional Test generation enabled
  • xRay API token or Jira credentials with xRay permissions