RALLY: Determine a parent User Story's release

血红的双手。 提交于 2019-12-01 04:24:30

问题


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
    |__ Sub Story 3
         |_ Child Story 4

I want to make a view of all Parent stories and what release they are currently scheduled in. Once the Parent story has child stories it's release value is not editable because it is set in a lower story. Is there a way to determine what release the story would be completed in with only making 1 call to Rally?

Thanks!


回答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.




回答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.



来源:https://stackoverflow.com/questions/7586312/rally-determine-a-parent-user-storys-release

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