How using python to get data for root milestones only?

for example i have something like this:

image.jpg (71.9 KB)

[image]
i want to get only MILESTONE 1 and MILESTONE 2, is it realistic to do without checking names in the loop?

@kmon,
there is no method which searches the task with the specified name.
If such a method existed, it would do a checking names in the loop for all project tasks or would maintain a map (Task Name -> Task) which would add unnecessary memory consuming.

Also, you could narrow your search if you know, for example, that MILESTONE N is always at the root level. In this case your could iterate over root task’s 1st level children instead of iteration over all project’s tasks.