2013-04-18 36 views
0

我正在使用下面的代碼從集會中檢索缺陷數據。目前,缺陷正在通過格式化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(); }

回答

0

拉力要求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都是必不可少的。

+0

它工作。 謝謝你的擡頭。 –