当我知道 Rally 中存在项目时,为什么使用用户故事名称和迭代进行查询会返回零项目?
我运行了这段代码,但它返回零个项目,但它应该返回一个项目,因为我知道它存在于 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);
顺便说一句...
myUserStory.Name = 有效的用户故事名称 myUserStory.Iteration = 用户故事所属的有效迭代名称
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您将第二个查询子句值更改为 myUserStory.Iteration.Name 我打赌它会起作用。我的猜测是,如果您检查您的查询(并对其调用 ToString()),您将看到它尝试在 myUserStory.Iteration(另一个 DynamicJsonObject)上调用 ToString()。
我们还发现安装代理来检查实际请求和响应很有帮助。我们与 Charles 合作得很顺利:http://www.charlesproxy.com/
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/