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


#1

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.

example:

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

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


#2

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:

http://docs.gurock.com/testrail-integration/defects-plugins-custom#pushing_defects_without_a_dialog

(see $context in the second code listing)

I hope this helps!

Regards,
Tobias


#3

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


#4

You are welcome, Gavin!