上次更新日期过滤拉力赛缺陷

时间:2013-04-18 07:59:42

标签: .net filter rally defects

我使用以下代码从集会中检索缺陷数据。目前,该缺陷正在按格式化ID进行过滤。

有没有办法可以按上次更新日期过滤结果?

例如: string queryString = @“(LastUpdateDate< 4 \ 5 \ 2013)”;

static void Main(string[] args)

{

RallyServiceService service = new RallyServiceService();

string rallyUser = "username";

string rallyPassword = "password";

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(); }

1 个答案:

答案 0 :(得分: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,因此使用REST对于任何希望新Web服务功能向前发展的人来说都是必不可少的。