Question

Apparently it is impossible to provide the Changed Date field with a timestamp (format '2009-12-14 10:00:00') when defining a new Team Query. I get the error: "The query failed. You cannot supply a time with the date when running a query using date precision.".

Is there a workaround for this? I just want a list of work items which are changed since the last 'x' minutes.

Was it helpful?

Solution

OTHER TIPS

You to enter the date in the same format as it is displayed by VSTS: dd-MMM-YY (01-Jan-16).

In order to filter your items in TFS by a specific date, stick to this format: enter image description here

I ran into the same problem while trying to query for the latest updates and worked around it by doing the following

// defined elsewhere
private DateTime lastUpdated;


string consult = "select * from WorkItem where [Created Date] > ' "  + lastUpdated.ToString("MM/dd/yy") + 
                    "' AND [Work Item Type] = 'Test Case'";

IEnumerable<ITestCase> tcc = testManagementTeamProject.TestCases.Query(consult).Where(tp => tp.DateCreated > lastUpdated);

I did something very similar for retrieving test results

The last parameter of this query constructor lets you define the precision:

dayPrecision

When TRUE, indicates that a DateTime should resolve to an entire day. Often, it is TRUE to avoid being more precise about a specific time.

try adding query parameter timePrecision:true. This worked for me

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top