Rally 检索用户故事及其关联的测试用例

Rally 检索用户故事及其关联的测试用例,rally,excel-addins,Rally,Excel Addins,我正在使用Rally excel加载项并尝试检索用户故事和相关测试用例。我在报告“User Story”中添加了额外的列以检索TestCase.Name,并尝试了TestCase.FormattedID。在这两种情况下,我都会收到空列。我做错了什么? 此外,还有一列“测试用例数”也总是不返回任何内容 这里是一个定制应用程序,它构建了一个由用户故事和相关测试用例组成的网格。看起来这是要显示的数据: 该代码在中提供。您可以将html文件复制/粘贴到自定义页面中 Ext.define('Custom

我正在使用Rally excel加载项并尝试检索用户故事和相关测试用例。我在报告“User Story”中添加了额外的列以检索TestCase.Name,并尝试了TestCase.FormattedID。在这两种情况下,我都会收到空列。我做错了什么?
此外,还有一列“测试用例数”也总是不返回任何内容

这里是一个定制应用程序,它构建了一个由用户故事和相关测试用例组成的网格。看起来这是要显示的数据:

该代码在中提供。您可以将html文件复制/粘贴到自定义页面中

Ext.define('CustomApp', {
    extend: 'Rally.app.TimeboxScopedApp',
    componentCls: 'app',
    scopeType: 'iteration',
    comboboxConfig: {
        fieldLabel: 'Select an Iteration:',
        labelWidth: 100,
        width: 300
    },

   onScopeChange: function() {
        Ext.create('Rally.data.WsapiDataStore', {
            model: 'UserStory',
            fetch: ['FormattedID','Name','TestCases'],
            pageSize: 100,
            autoLoad: true,
            filters: [this.getContext().getTimeboxScope().getQueryFilter()],
            listeners: {
                load: this._onDataLoaded,
                scope: this
            }
        }); 
    },

     _onDataLoaded: function(store, data){
                var stories = [];
                var pendingTestCases = data.length;

                Ext.Array.each(data, function(story) {
                            var s  = {
                                FormattedID: story.get('FormattedID'),
                                Name: story.get('Name'),
                                _ref: story.get("_ref"),
                                TestCaseCount: story.get('TestCases').Count,
                                TestCases: []
                            };

                            var testcases = story.getCollection('TestCases');
                            testcases.load({
                                fetch: ['FormattedID'],
                                callback: function(records, operation, success){
                                    Ext.Array.each(records, function(testcase){
                                        s.TestCases.push({_ref: testcase.get('_ref'),
                                                        FormattedID: testcase.get('FormattedID'),
                                                        Name: testcase.get('Name')
                                                    });
                                    }, this);

                                    --pendingTestCases;
                                    if (pendingTestCases === 0) {
                                        this._createGrid(stories);
                                    }
                                },
                                scope: this
                            });
                            stories.push(s);
                }, this);
    } ,            

    _createGrid: function(stories) {
        var myStore = Ext.create('Rally.data.custom.Store', {
                data: stories,
                pageSize: 100,  
            });
        if (!this.grid) {
        this.grid = this.add({
            xtype: 'rallygrid',
            itemId: 'mygrid',
            store: myStore,
            columnCfgs: [
                {
                   text: 'Formatted ID', dataIndex: 'FormattedID', xtype: 'templatecolumn',
                    tpl: Ext.create('Rally.ui.renderer.template.FormattedIDTemplate')
                },
                {
                    text: 'Name', dataIndex: 'Name'
                },
                {
                    text: 'TestCase Count', dataIndex: 'TestCaseCount'
                },
                {
                    text: 'Test Cases', dataIndex: 'TestCases', flex:1,
                    renderer: function(value) {
                        var html = [];
                        Ext.Array.each(value, function(testcase){
                            html.push('<a href="' + Rally.nav.Manager.getDetailUrl(testcase) + '">' + testcase.FormattedID + '</a>' + ' ' + testcase.Name);
                        });
                        return html.join(', ');
                    }
                }
            ]
        });

         }else{
            this.grid.reconfigure(myStore);
         }
    }
});
就Excel addin而言,我在用户故事查询中没有看到显示与故事相关联的测试用例的列。由于TestCases是HierarchicalRequirement对象的集合,因此必须在单独的查询中获取各个测试用例。这就是我在上面代码中所做的

这是我的Excel插件的屏幕截图。存在TestCaseStatus,这是预期的,但不包括TestCases集合,因为集合将只返回uri。也许您正在使用自定义工具从Rally导出到Excel


使用TestCases.FormattedID,它将在单个单元格中提供所有链接的测试用例,并用逗号分隔。

感谢您提供此解决方案。问题:如何摆脱“迭代”下拉列表,因为我们实际上是按照“发布”条款操作的。此外,我还找到了解决问题的另一个方法:在Rally中创建报告,然后将其导出为.csv,然后编写一些excel宏来正确解析它。在他们对拉力赛报告应用分组(在UI上显示为Pivot报告)之前,您知道是否可以下载拉力赛报告作为普通原始数据吗?您可以将scopeType form iteration更改为release。我用这些信息更新了帖子。获取“原始数据”的方法是直接查询WS-API,但是如果您需要获取集合的元素,则需要两个单独的请求—一个是关于用户情景(包括测试用例集合)的请求,然后是关于集合本身的请求。
Ext.define('CustomApp', {
    extend: 'Rally.app.TimeboxScopedApp',
    componentCls: 'app',
    scopeType: 'release',
    comboboxConfig: {
        fieldLabel: 'Select a Release:',
        labelWidth: 100,
        width: 300
    },