Rally - TestCase and TestCaseResult Fields Returning NULL in Defect WSAPI
search cancel

Rally - TestCase and TestCaseResult Fields Returning NULL in Defect WSAPI

book

Article ID: 435310

calendar_today

Updated On:

Products

Rally SaaS

Issue/Introduction

When querying the Defect endpoint via the Rally Web Services API (WSAPI), the TestCase and TestCaseResult fields return null even when the Defect appears to be linked to test cases or results in the Rally UI.

Environment

Rally SAAS

Cause

In the Rally WSAPI object model, the TestCase and TestCaseResult fields on a Defect are singular object references (foreign keys). These fields are only populated if the Defect was created directly from a specific Test Case or Test Case Result.

General associations or links between Defects and Test Cases are stored in the TestCases collection, which is separate from the singular reference fields.

Resolution

To retrieve the associated test cases and results for a defect, you must query the TestCases collection instead of the singular fields.

Steps to Retrieve Linked Test Cases

  1. Identify the ObjectID of the Defect.
  2. Query the TestCases collection endpoint for that defect using a fetch parameter to include relevant fields (e.g., FormattedIDLastResultResults).

Example Query: Review this command before running it.

/slm/webservice/v2.0/defect/[DEFECT_ID]/testcases?fetch=FormattedID,LastResult,LastResultVerdict,Results

This query will return the full list of associated test cases and their respective results as a collection, rather than a single inline object.