Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

[Defect Plugin] Retrieve data from Test Case Result


I am attempting to use the defect plugin with Rally.
I wish to retrieve the value in the ‘Version’ field the user has specified in TestRail in the test result so that I can send this as the Found In Build value.

I have attempted to modify the script to extract the value from tests and case objects but the version object is not defined.


$test = current($context['tests']); $testVersion = $test->version; #Also have tried $testVersion = $test->case->version; return $testVersion;

Error returned is: Undefined property: stdClass::$version


Hello Gavin,

Thanks for your posting. The fields on the Add Test Result dialog are part of the ‘test_change’ property and this looks as follows:

$version = $context[‘test_change’]->version;

A reference can be found here:

(see $context in the second code listing)

I hope this helps!



Yep that is it, thanks for the quick response, as always!!! :slight_smile:


You are welcome, Gavin!