This query is working to get the defects from a specific project:
QueryRequest defectRequest = new QueryRequest("defect");
defectRequest.setFetch(new Fetch("Project", "LastUpdateDate", "FormattedId", "SubmittedBy", "Owner"));
defectRequest.setQueryFilter(new QueryFilter("Project.Name", "=", rallyProjectName));
QueryResponse projectDefects = rallyApi.query(defectRequest);
But, it doesn’t work to get the defects from all the child projects of a parent project.
Instead of setting the project in the query filter use project scoping instead: