Skip to content Skip to sidebar Skip to footer

RALLY: Determine A Parent User Story's Release

In Rally we have the following story structure: Parent Story 1 |__ Sub Story 1 |   |__ Child Story 1 |   |__ Child Story 2 | |__ Sub Story 2     |__ Child Story 3    �

Solution 1:

If you wanted to get a list of a parent story's children to see what release they fall in you could use the following query.

(Parent.Parent.FormattedID = ###PUT THE FORMATTED ID HERE###)

If you want to experiment in your browser you can try the following URL.

https://rally1.rallydev.com/slm/webservice/1.26/hierarchicalrequirement.js?query=(Parent.Parent.FormattedID=###PUT_THE_FORMATTED_ID_HERE###)&fetch=Release&pretty=true

If you knew that the children stories would all be in the same release you could put a &pagesize=1 and look at the release for that single returned story while saving a bit of bandwidth.

One of the weird parts about this query is that you will have to know how deep the stories you want to retrieve are from the parent you are interested in. In the case of your example your hierarchy is two deep so in the query you use the Parent.Parent of the stories I am trying to retrieve.


Solution 2:

The easiest solution I have 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'm guessing if epiclevel3 still has stories then you could build a new query array for the next 3 levels and recursively call the same "doStuffWithResults" method. Just a thought. I haven't tested that.


Post a Comment for "RALLY: Determine A Parent User Story's Release"