0
votes

I am facing a problem of retrieving associated work items. What do I mean and do: the task is to get all changesets without a code review request for the previous sprint/month. In a perfect word, I'd like to get such a tree: Tasks -> changesets -> code review requests.

The bad thing is that I cannot get those changesets as they are associated with Task and CodeReviewRequest:

enter image description here

If I go in Queries, I do not see neither an option to link Task with a changeset nor select a changeset as a Work Item Type:

enter image description here

Could you please someone help with this?

Cece, here is what I got using your query:

enter image description here

3
Which version of TFS/DevOps Server do you use? - Cece Dong - MSFT

3 Answers

1
votes

On the site of Microsoft developer community I received an answer that it is not possible to create such kind of query in TFS. Proof:

https://developercommunity2.visualstudio.com/t/Retrieving-a-tree-of-linked---associate/1310587?entry=myfeedback&space=22

0
votes

You should be able to query the elements for your query using the REST API.

Query:

  • tasks changed in the last sprint
  • changesets made in the last sprint
  • code reviews done in the last sprint

Then match up the results in PowerShell or another scripting language.

It's not as easy as a work item query and you can't easily create a dashboard widget from it, but it isn't hard to get to the data you're after.

Another route you could look into is to use the Analytics API or the OData API from azo reporting tool such as PowerBI. That would give you a way more powerful querying ability.

0
votes

It's not able to get a tree query like: Tasks -> changesets -> code review requests. If you want to get all changesets with associated work items for the previous sprint. You could use Changesets - Get Changesets api to get the changesets for a range of dates. Then use Changesets - Get Changeset Work Items api to get the work items associated with a particular changeset. After that, filter the changesets that have "workItemType": "Code Review Request".