0

我正在使用以下代码从反弹中检索缺陷数据。目前,缺陷正在通过格式化 ID 过滤。

有什么办法可以按最后更新日期过滤结果吗?

例如:字符串 queryString = @"(LastUpdateDate < 4\5\2013)";

静态无效主要(字符串 [] 参数)

{

RallyServiceService 服务 = 新的 RallyServiceService();

string rallyUser = "用户名";

string rallyPassword = "密码";

service.Url = "https://rally1.rallydev.com/slm/webservice/1.41/RallyService"; System.Net.NetworkCredential credential = new System.Net.NetworkCredential(rallyUser, rallyPassword); Uri uri = new Uri(service.Url); System.Net.ICredentials credentials = credential.GetCredential(uri, "Basic"); service.Credentials = credentials; service.PreAuthenticate = true; service.CookieContainer = new System.Net.CookieContainer(); // Find Defect //string queryString = @"(LastUpdateDate < 4\5\2013)"; String queryString = "(FormattedID = DE577)"; // Order by FormattedID Ascending string orderString = "FormattedID asc"; bool fetchFullObjects = true; // Paging information long start = 0; long pageSize = 200; // issue query QueryResult queryResult = service.query(null, "Defect", queryString, orderString, fetchFullObjects, 1, 20); // look at the object returned from query() Console.WriteLine("Query returned " + queryResult.TotalResultCount + " objects"); Console.WriteLine("There are " + queryResult.Results.Length + " objects on this page"); for (int i = 0; i < queryResult.Results.Length; i++) { DomainObject rallyobject = queryResult.Results[i]; Defect defect = (Defect) rallyobject; Console.WriteLine("Date: "+defect.LastUpdateDate); } Console.ReadKey(); }
4

1 回答 1

0

Rally 需要 ISO8601 格式的日期,因此格式的查询字符串:

string queryString = "(LastUpdateDate < \"2013-04-15\")";

应该为你工作。

提醒一下,特别是如果您刚刚开始构建集成,我强烈建议您使用 Rally 的.NET REST SDK之一,而不是 SOAP。

REST 更健壮、性能更高,而且,Webservices API 1.4x(x 尚未确定)将是支持 SOAP 的最终 API 版本。Webservices 2.x 将仅支持 REST,因此对于任何希望推进新的 Web 服务功能的人来说,使用 REST 将是必不可少的。

于 2013-04-18T12:44:55.247 回答