1

I am building an email report about VSTS work items where I have some links that should open VSTS queries. The WIQL query is passed as part of the hyperlink URL, see the following link:

Define a query as a hyperlink

I pass the DateTime as date and time ([System.CreatedDate] >= '2019-02-18T08:00:00.0000000Z') not only date. The page that opens has the following error

You cannot supply a time with the date when running a query using date precision. The error is caused by «[System.CreatedDate] >= '2019-02-18T08:00:00.0000000Z'».

I tried to add ?timePrecision=true at the end of the URL but it doesn't help.

Any idea how can I use WIQL in hyperlink and pass date & time?

4

1 回答 1

0

查询作为超链接尚不支持timePrecision。您需要使用 rest api Wiql - Query By Wiql来使用时间精度,例如:

POST https://dev.azure.com/{organization}/{project}/{team}/_apis/wit/wiql?timePrecision=true&api-version=5.0

{
"query": "SELECT [System.ID], [System.Title], [System.State] FROM WorkItems WHERE [System.TeamProject]='xxxx' AND [System.CreatedDate]>='2019-01-25 11:00 AM'"
}

同时,您可以在下面的网站上提交建议,建议在timePrecision将 Query 定义为超链接时支持:

https://developercommunity.visualstudio.com/content/idea/post.html?space=21

于 2019-02-19T08:26:27.910 回答