Defect resolution status not updating linked Xray test execution results

We’re using Xray for Test Management on Jira DC and have test executions linked to defect issues. When a defect that caused a test to fail gets resolved, we expect the linked test execution status to automatically update from ‘FAIL’ to ‘PASS’ (or at least trigger a re-test notification).

Currently, when we resolve a defect, the test execution status remains ‘FAIL’ and our QA dashboard shows incorrect pass/fail metrics. We have to manually open each linked test execution and update the status, which defeats the purpose of automation.

We added a post-function to the defect’s ‘Resolve’ transition:


XrayTestExecution.updateStatus(
  linkedTestExecutions, "PASS"
)

But this doesn’t seem to be working - the test executions still show ‘FAIL’ after the defect resolution. We’ve verified the defect-to-test-execution links are correct using the ‘Tests’ tab on the defect issue. Is there a specific Xray workflow configuration needed to propagate defect resolution status back to test executions in DC environments?

Your post-function syntax doesn’t look right for Xray. Xray doesn’t expose a direct XrayTestExecution.updateStatus() method in workflow post-functions. You need to use Xray’s REST API or configure a post-function that calls the Xray webhook to trigger test execution status updates. Check Xray’s documentation for the correct API endpoint to update test run status.

Post-function order is critical. The Xray post-function must run AFTER ‘Update issue’ and ‘Create event’ but BEFORE ‘Re-index issue’. If it runs too early, the defect status isn’t committed yet. If it runs too late, the test execution update might not propagate to the index. Drag the Xray function to just after ‘Fire event’ in your post-function list and test again.

Your issue stems from incorrect Xray workflow post-function configuration and execution order. Here’s the comprehensive solution:

Xray workflow post-function configuration: Remove your custom post-function with XrayTestExecution.updateStatus() - this is not a valid Xray API method. Instead, use Xray’s built-in post-function. In your workflow editor, select the ‘Resolve’ transition, click ‘Post Functions’, and add ‘Update Linked Test Execution Status’ (provided by Xray). Configure it to set the test execution status to ‘TODO’ rather than ‘PASS’ - this flags the test for re-execution by your QA team, which is more appropriate than automatically marking it as passed just because the defect is resolved.

If you don’t see Xray post-functions in the list, verify Xray is properly installed and enabled: Admin > Manage Apps > Xray for Jira > ensure it’s enabled and has workflow post-function modules active.

Order of post-functions affecting status updates: This is critical for reliable execution. Your post-function order should be:

  1. Set issue status to the linked status (default)
  2. Update change history (default)
  3. Fire event that can be processed by listeners (default)
  4. Update Linked Test Execution Status (Xray) ← Add here
  5. Re-index issue (default)

The Xray function must run AFTER ‘Fire event’ so the defect status change is fully committed to the database, but BEFORE ‘Re-index issue’ so the test execution status update is included in the index refresh. If Xray runs too early, it reads the old defect status; too late, and the test execution update doesn’t propagate to search/dashboards.

Bulk recalculation of test execution status: For the 40% of test executions that didn’t update (likely from earlier defect resolutions before you fixed the post-function), you need to bulk recalculate. Use Xray’s REST API to trigger bulk updates:

Navigate to Admin > System > Advanced > REST API Browser, or use curl:


POST /rest/raven/1.0/api/testexec/{testExecKey}/status
{"status": "TODO"}

Alternatively, create a JQL filter for failed test executions linked to resolved defects: type = "Test Execution" AND status = FAIL AND issueFunction in linkedIssuesOf("status = Resolved", "is tested by"), then use Xray’s bulk operations to set status to ‘TODO’.

Defect-test traceability in DC environments: In Jira DC, ensure your Xray license covers all nodes and that the Xray index is synchronized across the cluster. Check Admin > System > Xray Settings > Index Status. If the index is out of sync, test execution updates may not propagate correctly across nodes. Run ‘Rebuild Xray Index’ if you see inconsistencies.

For dashboard accuracy, configure your QA dashboard gadgets to use Xray’s native test execution filters rather than generic Jira filters. This ensures real-time status updates are reflected correctly without index lag.