RALLY: Determine a parent User Story's release

夙愿已清 提交于 2019-12-01 06:29:15

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.

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!