Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

How to get list of sub milestones


#1

Hi,

I can get a list of milestones in our project.
ms_response = self.api.get_milestones(project_id=self.project_id, is_started=True)
for ms in ms_response:
print(“MS: {0}”.format(ms))

This returns a list of milestones
1.0
1.1
1.2
1.3 etc…

However, Milestone 1.2 has submilestones…
1.2.1
1.2.2…

How do i get the milestone id’s of these?

Thanks


#2

WIth the id of the milestone you can use the api method get_milestone and this return informations about the milestone and an array with sub-milestone : http://docs.gurock.com/testrail-api2/reference-milestones#get_milestone but i’m surprised that the get_milestones method don’t return this array.


#3

I’d actually like to put something like…

if Milestone_name == “1.2.1”
get_milestone_id

But as it only returns the top level milestones, i don’t see the 1.2.1, 1.2.2 etc in the list…

Ideally for all the 1.1’s, 1.2 releases i’d like to get the id’s of their sub-milestones.


#4

One of the things they need to do is go back to the API after the recent changes to Test Rail and incorporate the new items like sub-milestones.