Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS query by WIQL does not return requested fields

I'm building a Widget in VSTS and I'm calling the queryByWiql() method from Work Item Tracking rest client.

The query I have is:

queryString = {
    "query": "Select [Microsoft.VSTS.Scheduling.RemainingWork]
     From WorkItems
     Where [System.WorkItemType] = 'Task'
     AND [System.State] <> 'Done'
     order by [System.CreatedDate] desc"
};

But the result looks like this, where none of the work item actually contain the Remaining Work Information:

enter image description here

This is true for any fields I request; Title, State, Assigned To etc. The fields I've requested will appear under columns. But none of the work items themvselves will have the information.

Why is this the case? And how can I fix it? Cheers

like image 632
davidx1 Avatar asked Jul 18 '16 05:07

davidx1


1 Answers

This is an expected behavior. Currently, there is no way to call the API to return the detailed work item information from a WIQL query directly. You need to get these information in two steps:

  1. Get the ID of the work items from a WIQL which you have done.
  2. Get these work items via Get a list of work items by ID. And you can specify the field to get at this step.

Instruction on WIQL Query page:

After executing a query, get the work items using the IDs that are returned in the query results response. You can get up to 200 work items at a time.

like image 183
Eddie Chen - MSFT Avatar answered Oct 29 '22 15:10

Eddie Chen - MSFT