The easiest solution I found is to do the following:
var epicLevelStories = { key: 'epics', type: 'hierarchicalrequirement', fetch: 'FormattedID,Name,ObjectID,Release' query: epicQuery, order: 'FormattedID' }; var epicLevel2Stories = { key: 'epiclevel2', placeholder: '${epics.children?fetch=Name,FormattedID,Parent,Release}' }; var epicLevel3Stories = { key: 'epiclevel3', placeholder: '${epiclevel2.children?fetch=Name,FormattedID,Parent,Release}' }; var queryArray = [epicLevelStories, epicLevel2Stories, epicLevel3Stories]; rallyDataSource.findAll(queryArray, doStuffWithResults);
Once you get a result set (epiclevel #) that has no entries, you know you have reached the bottom of the tree.
I assume that if epiclevel3 still has stories, then you can build a new array of queries for the next 3 levels and recursively call the same doStuffWithResults method. Just a thought. I have not tested this.
source share