How can WSAPI be used to return the work items (for example, user stories) of a milestone and in-general to explore the Milestone <-> Work Item relationship ?
Let's use User Stories as an example:
The relationship between Milestones and User Stories is stored on both end points. Hence, there are a couple of ways you can go about exploring it:
1. Use the HierarchicalRequirement endpoint.
2. Use the Milestone endpoint.
Using the HierarchicalRequirement endpoint.
Below is an example of a query that is going to return all user stories which have a milestone and also that the milestone’s name is “milestone_2”. The first part of the query is ensuring there is a milestone that’s linked with the user story. The second part is filtering by the name of the milestone.
Using the Milestone endpoint.
The Artifacts field is the one that has all the artifacts linked to that milestone. In order to find milestones that have any artifact (in other words , to exclude those which don’t) then you can use (Artifacts.ObjectID > 0).
You should call the Artifacts collection such as in: