Hi Tiwary.
There is a bit of a misconception here which I'm hoping to help clarify.
Rally provides 3 types of timeboxes: Milestones, Releases and Iterations. They serve different purposes and are intended to encompass quite largely different time frames. Releases and Iterations are designed for relatively short time frames and they are part of a single project. You create these timeboxes within a given project and they exist within its boundaries.
Milestones are different. Milestones are designed to be a check/delivery point much larger in time for multiple projects. The Milestone timebox does not exist within the boundaries of a given project but instead multiple projects are scoped to the milestone. You can see it as a relationship of inclusion or association where the projects are included or are 'part of' a milestone.
Once associated with a milestone, you can get the list of these projects by fetching the "Projects" field of your milestone. For example, see in your screenshot that the Projects field is a reference to a collection of projects. In your screenshot it so happens that there is only 1 project in that collection, you can see it in the Count that's part of the Projects field reference. If you shall include/scope additional projects to your milestone they will be part of that collection and the counter will accurately update.
With this practice the milestone isn't 'under' a project, as you had asked. If anything, it's more the other way around where the project is part of or associated with the milestone. If you wanted to find all the milestones that a given project belongs to you can execute a query against the Milestones endpoint with a query filter for your project, such as: (Projects.Name = "My Project") . Another alternative for such a query filter could be: (Projects.ObjectID = <Your Project OID>) . In this mode the projects that are part of milestones don't have to conform to any hierarchical structure and therefore there isn't a straight forward way to find the hierarchy of projects of this milestone. So, for example, if I were to associate "My Project" to the milestone along with a few of its children projects, then, I can run this example query filter for each project individually. There isn't is in this mode to query for all the milestones that include both "My Project" as well as any of its hierarchy.
You can also choose to dedicate a milestone to a project. A possible reason to do is if you have a heavy-duty project that has an extensive project hierarchy underneath where it makes sense that a milestone of a large time frame will be dedicated only to that hierarchy and not go beyond it to other projects outside of it. If you wanted to do that then you can update the milestone's TargetProject field. As you had mentioned this field is not set by default and there isn't a way to set it from the user interface. However, you can use a WSAPI post command and update this field. Once you did then the Projects field collection will be replaced with the entire hierarchy that's under the project you're targeting. In this mode you can fetch the Projects field and rely on that it shall include the hierarchy under your target project.
Please let us know if this helped and if next questions.
Thanks,
Sagi