سؤال

I am using the below code to retrieve the Defect data from rally. Currently, the defect is being filtered by Formatted ID.

Is there any way through i can filter the result by last updated date?

eg: 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(); }
هل كانت مفيدة؟

المحلول

Rally requires ISO8601-formatted Dates, so a query string of the format:

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

Should work for you.

Just a heads-up, especially if you're just getting started with building your integration, I'd highly recommend using one of Rally's .NET REST SDK instead of SOAP.

REST is more robust, more performant, and, Webservices API 1.4x (x is yet-to-be-determined) will be the final API release to have SOAP support. Webservices 2.x will be REST-only, so using REST will be essential to anyone wanting new Webservices features moving forward.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top