这是一个自定义应用程序,它构建了用户故事和相关测试用例的网格。看起来这是您要显示的数据:
该代码可在这个 github 仓库 https://github.com/nmusaelian-rally/test-cases-of-stories。您可以将 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);
}
}
});
如果您更喜欢按版本而不是迭代进行过滤,您可以更改scopeType
of Rally.app.TimeboxScopedApp
Ext.define('CustomApp', {
extend: 'Rally.app.TimeboxScopedApp',
componentCls: 'app',
scopeType: 'release',
comboboxConfig: {
fieldLabel: 'Select a Release:',
labelWidth: 100,
width: 300
},
就 Excel 插件而言,我在用户故事查询中没有看到可用的列来显示与故事相关的测试用例。由于测试用例是分层需求对象的集合WS API https://rally1.rallydev.com/slm/doc/webservice/必须进行单独的查询才能获取各个测试用例。这就是我在上面的代码中所做的。
这是我的 Excel 插件的屏幕截图。有 TestCaseStatus,这是预期的,但不包括 TestCases 集合,因为该集合仅返回 uri。也许您正在使用自定义工具从 Rally 导出到 Excel。