如何在Rally中获取用户素材的ScheduleState和StoryType

时间:2014-03-19 19:31:56

标签: rally

我正在尝试创建自定义HTML网格,以显示所有用户故事的列表及其不同的属性,包括姓名,ID,日程安排状态和故事类型。 我没有得到状态和类型,获取id和名称以及其他一些字段。

下面是用于获取它们的代码片段:

onScopeChange: function() {
    Ext.create('Rally.data.WsapiDataStore', {
        model: 'UserStory',
        fetch: ['FormattedID','Name','State', 'Type','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"),                                
                            State: story.get('ScheduleState'),
                            Type: story.get('StoryType'),
                            TestCaseCount: story.get('TestCases').Count,
                            TestCases: []
                        };

1 个答案:

答案 0 :(得分:0)

您的提取不包含'ScheduleState':

fetch: ['FormattedID','Name','State', 'Type','TestCases'],

ScheduleState在UI中显示为State以保持简短,但在WS API中它被称为ScheduleState。请与WS API核对字段名称。在对象模型中查找HierarchicalRequirement。

您也可以在fetch中引用Type作为Type,稍后再引用StoryType。根据名称,它看起来像是一个自定义字段。在WS API中,它将具有c_ prepended。