I am trying to get all user stories and defect attach with particular milestone in rally and I'm using pyral.
I can't find any documentation or any example of it.
Any help will we appreciated.
An example of fetching User Stories using the python toolkit can be found in this python examples repo.
Where you will want to update this code is within the line specifying the query criteria:
criterion = '((Iteration.Name contains "Iteration 6")OR(Iteration.Name contains "Iteration 7"))'
Instead of specifying an Iteration Name, you will need to provide the milestone _ref like so:
criterion = '(Milestones contains "/milestone/12345678")'
And then to get all of the Defects, you would run the same query but request 'defect' instead of 'hierarchicalrequirement'
A different approach would be to make a single request and specify type 'artifact' since user stories and defects both inherit from type 'artifact'.