4
I am trying to perform a query using the TFS API where I need to get all the Workitems that have been edited from a certain date, however I get the following error:
An unhandled Exception of type 'Microsoft.TeamFoundation.Workitemtracking.Client.Validationexception' occurred in Microsoft.TeamFoundation.Workitemtracking.Client.dll
Additional information: You cannot Supply a time with the date when running a query using date Precision. The error is caused by «[Changed Date] > '09/11/2015 14:12:43'».
I need to query using the date and time, but I think that’s what’s causing the error, below the code I’m using for the query:
var query = "SELECT [ID] FROM WorkItem WHERE [Work Item Type] = '{0}' AND [Changed Date] > '{1}'";
var workItens = GetWorkItemStory().Query(string.Format(query, WORKITEM_TYPE, dataBase));
return (from WorkItem workItem in workItens select workItem).ToList();
Any idea what I can do to solve the problem?
It’s not POG. It’s the right way. + 1.
– Leonel Sanches da Silva
@pedrocamarajunior o It helps a lot, leaves the code leaner!
– user28366