Click or drag to resize
RallyRestApiQuery Method
Perform a read against the WSAPI operation based on the data in the specified request

Namespace: Rally.RestApi
Assembly: Rally.RestApi (in Rally.RestApi.dll) Version: 3.1.1.0 (3.1.1.0)
Syntax
public QueryResult Query(
	Request request
)

Parameters

request
Type: Rally.RestApiRequest
The request configuration

Return Value

Type: QueryResult
A DynamicJsonObject with the response from Rally.
Exceptions
ExceptionCondition
RallyUnavailableExceptionRally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information.
RallyFailedToDeserializeJsonThe JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
Examples
C#
// Build request
Request request = new Request("defect");
request.Fetch = new List<string>() { "Name", "Description", "FormattedID" };

request.Query = new Query("Name", Query.Operator.Equals, "My Defect").And(new Query("State", Query.Operator.Equals, "Submitted"));

// Make request and process results 
QueryResult queryResult = restApi.Query(request);
foreach (var result in queryResult.Results)
{
    string itemName = result["Name"];
}
See Also