robnardo
robnardo

Reputation: 931

Why does querying using User Story Name and Iteration return zero items when I know it exists in Rally?

I ran this code, but does it returns zero items but it should return one item because I know it exists in Rally.

var request = new Request("hierarchicalrequirement")
{
Fetch = new List<string>() { "ObjectID" },
Query = new Query("Name", Query.Operator.Equals, myUserStory.Name)
.And(new Query("Iteration.Name", Query.Operator.Equals, myUserStory.Iteration))    
};
QueryResult queryResult = _restApi.Query(request);

by the way...

myUserStory.Name = a valid User Story name myUserStory.Iteration = a valid Iteration name that the User Story belongs to

Upvotes: 2

Views: 820

Answers (1)

Kyle Morse
Kyle Morse

Reputation: 8410

If you change your second query clause value to be myUserStory.Iteration.Name I bet it will work. My guess is that if you examine your Query (and call ToString() on it) you will see it is trying to call ToString() on myUserStory.Iteration, which is another DynamicJsonObject.

We have also found it helpful to have a proxy installed to examine the actual requests and responses. We have had good luck with Charles: http://www.charlesproxy.com/

Upvotes: 3

Related Questions