Testopia:Documentation:XMLRPC:Query Examples: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
 
No edit summary
 
Line 1: Line 1:
Back to [[Testopia:Documentation:XMLRPC]]
Back to [[Testopia:Documentation:XMLRPC]]


==Query Examples==
=Query Examples=
 
==Simple Queries==
 
===Overview===
 
Simple queries use a list of attribute name/value pairs to seach for a set of records.
 
The name/value pairs in a list are combined with the logical '''AND''' operator to form more complex queries.
 
To find a test plan with an id of 1:
 
<b>Perl</b>
 
$proxy->call('TestPlan.list', {plan_id=>1});
 
To find a test case run with a build id of 1 and a case id of 1 and a run id of 1:
 
<b>Perl</b>
 
$proxy->call('TestCaseRun.list', {build_id=>1, case_id=>1, run_id=>1});
 
====Simple Attributes====
 
* case_status_id
* category
* category_id
* priority_id
* component
* isautomated
* case_run_status_id
* default_product_version
* run_product_version
* type_id
* build
* build_id
* environment_id
* milestone
* env_products
* env_categories
* env_elements
* env_properties
* env_expressions
* case_status
* priority
* environment
* plan_type
* case_run_status
 
===Static Text (String) Queries===
 
String queries require <b>two</b> name/value pairs.  There first value pair is the attribute name and the value being search for.  The second name/value pair is the attribute name appended with the keyword, <b>_type</b>, and the value is the type of search operation being conducted.
 
To find a test plan with the name, "Unit Test Plan":
 
<b>Perl</b>
 
$proxy->call('TestPlan.list', {name=>'Unit Test Plan', name_type='anyexact'});
 
====Static text attributes====
 
* author
* manager
* default_tester
* assignee
* testedby
* case_summary
* summary
* tcaction
* tceffect
* script
* requirement
* name
* plan_text
* environment
* notes
* env_value_selected
 
==== Valid Search Operations====
* equals
* notequals
* isnull
* isnotnull
* lessthan
* greaterhthan
* regexp
* noteregexp
* anywords
* allwords
* nowords
 
===Special Queries===
 
The id attributes for TestCase, TestPlan, and TestRun have respective name/value pairs for creating static-text-like searches.  In other words, you can use same search operations defined for static text attributes.
 
* case_id uses caseidtype
 
* plan_id uses planidtype
 
* run_id uses runidtype
 
To find all Test Plans with id less than 200:
 
<b>Perl</b>
 
$proxy->call('TestPlan.list', {plan_id => 200, planidtype => "lessthan"})
 
==Queries Using Binary Charts==


===Overview===
===Overview===
Line 71: Line 178:
====Perl====
====Perl====


  %query = {
  $query = {
           field0-0-0 => "plan_id",
           "field0-0-0" => "name",
           type0-0-0  => "equals",
           "type0-0-0" => "anywords",
           value0-0-0 => 1
           "value0-0-0" => "Second"
           };
           };


141

edits

Navigation menu