使用SDK通过组合项收集缺陷



有没有人知道一种方法来拉出所有与使用sdk 2的史诗相关的缺陷?我们所有的投资组合项目都分配给一个根,而我们的开发团队分配给另一个根。通过用户故事的父节点,有从一边到另一边的链接,但是我还没有找到一种方法来查看与特定史诗相关的所有缺陷。建议吗?

获取与投资组合项/特性间接相关的缺陷有不同的方法。下面是一个例子,其中一个特性存储是由当前版本创建和过滤的,然后,使用承诺,它加载特性,然后是相关的史诗故事,然后是相关的子故事,然后是相关的缺陷,最后构建一个按需求分组的缺陷网格:

Ext.define('CustomApp', {
    extend: 'Rally.app.App',
    launch: function() {
        var that = this;
        var today = new Date().toISOString();
        var features = Ext.create('Rally.data.wsapi.Store', {
            model: 'PortfolioItem/Feature',
            fetch: ['UserStories'],
            filters: [
                {
                    property: 'Release.StartDate',
                    operator: '<=',
                    value: today
                },
                {
                    property: 'Release.ReleaseDate',
                    operator: '>=',
                    value: today
                }
            ]
        });
        features.load().then({
            success: this.loadStories,
            scope: this
        }).then({
            success: this.loadChildStories,
            scope: this
        }).then({
            success: this.loadDefects,
            scope: this
        }).then({
            success:function(results) {
                that.makeGrid(results);
            },
            failure: function(){
                console.log("oh noes!")
            }
        });
    },
    loadStories: function(features){
        console.log("features",features)
        var promises = [];
        _.each(features, function(feature){
            var stories = feature.get('UserStories');
            if (stories.Count > 0) {
                stories.store = feature.getCollection('UserStories',{fetch:['Name','FormattedID','Children','Defects','Feature']});
                promises.push(stories.store.load());
            }
        });
        return Deft.Promise.all(promises);
    },
    loadChildStories: function(stories){
        stories = _.flatten(stories);
        console.log("stories",stories);
        var promises = [];
         _.each(stories, function(story){
            var childStories = story.get('Children');
            if (childStories.Count > 0) {
                childStories.store = story.getCollection('Children',{fetch:['Name','ObjectID','FormattedID','Defects']});
                promises.push(childStories.store.load());
            }
        });
        return Deft.Promise.all(promises);
    },
    loadDefects: function(childStories){
        childStories = _.flatten(childStories);
        console.log("childStories",childStories);
        var promises = [];
         _.each(childStories, function(story){
            var defects = story.get('Defects');
            if (defects.Count > 0) {
                defects.store = story.getCollection('Defects',{fetch:['Name','ObjectID','FormattedID','Requirement','State']});
                promises.push(defects.store.load());
            }
        });
        return Deft.Promise.all(promises);
    },
    makeGrid: function(defects){
        defects = _.flatten(defects);
        console.log('defects', defects);
        var data = [];
        _.each(defects, function(defect){
            data.push(defect.data);
        });

        _.each(data, function(record){
            record.defectsParent = record.Requirement.FormattedID + " " + record.Requirement.Name;
        });
        this.add({
            xtype: 'rallygrid',
            showPagingToolbar: true,
            showRowActionsColumn: true,
            editable: false,
            store: Ext.create('Rally.data.custom.Store', {
                data: data,
                groupField: 'defectsParent',
            }),
            features: [{ftype:'groupingsummary'}],
            columnCfgs: [
                {
                    xtype: 'templatecolumn',text: 'ID',dataIndex: 'FormattedID',width: 100,
                    tpl: Ext.create('Rally.ui.renderer.template.FormattedIDTemplate')
                },
                {
                    text: 'Name',dataIndex: 'Name',
                },
                {
                    text: 'Story',dataIndex: 'Requirement',
                    renderer: function(val, meta, record) {
                        return '<a href="https://rally1.rallydev.com/#/detail/userstory/' + record.get('Requirement').ObjectID + '" target="_blank">' + record.get('Requirement').FormattedID + '</a>';
                    }
                },
            ]
        });
    }
});

相关内容

  • 没有找到相关文章

最新更新