Details
-
Bug
-
Status: Waiting Approval
-
Medium
-
Resolution: Unresolved
-
Xray Cloud 6.13.0
-
None
-
None
-
Chrome
Jira cloud
Description
Description
The Xray JQL function requirementsWithStatusByTestPlan() times out even when the target Test Plan contains zero tests (or just one test linked to one requirement). Root cause: the function performs a full project-wide requirement traversal before the Test Plan parameter is ever applied to scope the query.
Pre-conditions
- Xray Cloud instance with Test Coverage configured (coverable issue types, e.g. Epic/Story, with Test Coverage Hierarchy relations enabled).
- Project has subtasks, Epic-Issue relation, and a custom requirement-coverage issue link type all enabled simultaneously (confirmed present on the reference project "SCD" in the related ticket L3S-679: JQL function "issue in requirements()" does not work.Done; not confirmed as required, but present in all reported occurrences).
- A Test Plan referenced in the JQL call, even one with 0 or 1 test.
How to reproduce
- In a project with Test Coverage/requirement hierarchy configured, create or use a Test Plan that has zero tests attached (or only one test linked to one requirement).
- Run the JQL query: issue in requirementsWithStatusByTestPlan("OK", "<TEST_PLAN_KEY>") - e.g. issue in requirementsWithStatusByTestPlan("OK", "IFQ-14527")
- Observe the query times out instead of returning quickly (expected zero/near-zero result set).
Actual result/Attachments
The function getRequirementsWithStatusByTestPlan() delegates to getCoverableIssuesByScope(), which immediately calls TestCoverageService.fetchCoverableIssues() to recursively fetch ALL coverable requirements in the project scope. The testPlan parameter is only used afterward, in TestRunStatusManager.getMultiTestRunStatus(), for status calculation - not to limit the initial traversal. As a result the function performs a full project-wide requirement traversal (and can exceed the execution timeout) even when the Test Plan itself has no tests. A HAR file capturing the related requirements() timeout is attached on L3S-679: JQL function "issue in requirements()" does not work.Done; no dedicated HAR/log has been captured yet for this specific requirementsWithStatusByTestPlan() empty-Test-Plan case - should be requested from the reporter if dev needs it.
Expected result
The JQL function should validate/apply the Test Plan's contents early and filter traversal scope by the Test Plan before running the requirement search, so a Test Plan with 0 or few tests returns quickly without a full project-wide scan.
Version
- Xray Cloud
- Reported on tenant fgs-fr.atlassian.net (project IFQ) for this specific requirementsWithStatusByTestPlan() case
- Related original requirements() timeout reported on tenant swisslife.atlassian.net (project SCD, ~25k issues) - see L3S-679
Workaround
- Ensure the Test Plan contains at least one Test before executing requirementsWithStatusByTestPlan().
- If the Test Plan is intentionally empty, avoid running this JQL function - it will still perform full project-wide traversal before returning an empty result.
- Alternatively, use a more restrictive JQL (e.g. limit project or requirement scope) to reduce traversal size and lower the chance of timeout.
Attachments
Issue Links
- is duplicated by
-
XCC-3165 Loading...