I'm trying to write a dashboard widget that will calculate and display aggregates on a numeric field (e.g. Story points) beyond what is available in the out-of-the-box Query/Chart functionality.
My solution so far involves using the Work item tracking API to take a query configured by the user to define the work items to include in the aggregation.
At first I tried the queryById which seemed perfect except that it only returns the ID of the work items for the query and I need other fields.
Then I reasoned that I could fed the IDs back into getWorkItems to return those work items with the additional fields, and it worked fine.
So this all worked fine and returned what I needed, BUT here's the problem. The REST API call to getWorkItems requires a string of Work Item IDs, in some cases it could be thousands or tens of thousands of items which will probably exceed the limit on the querystring for a get request.
So here's what I'm hoping for: (one of the following)
(A) A way to call something that works like QueryById but returns additional fields in the result.
(B) A way to do the aggregation on the server instead of pulling down all the work items. I thought maybe a custom WIQL query, but it doesn't appear to have any operators like SUM, AVG, etc. Is it possible through one of the API's to just run a tSQL query against the work items?
Thanks for any help you can offer. If it is not possible to do either of the above consider it a feature request