Rally 2.1 SDK - 通过迭代过滤用户故事

时间:2018-06-01 18:24:21

标签: javascript json sdk rally

是否可以根据开始迭代和结束迭代之间的迭代来过滤用户故事。我能够从开始迭代向前和向后迭代向后过滤所有用户故事,但是当我在商店对象中使用“.and”过滤器时出现错误。

 var StartDateFilter = Ext.create('Rally.data.QueryFilter', {
        property: 'Iteration',
        operator: '>=',
        value: StartIteration
    });


    var UserStoryFilter = StartDateFilter.and(Ext.create(
        'Rally.data.wsapi.Filter', {
            property: 'Iteration',
            operator: '<=', // combines the the iterations so it receives all iterations in between 
            value: EndIteration
    }));


    var UserStoryFilter = StartDateFilter.and(EndDateFilter);


    this.defectStore = Ext.create('Rally.data.wsapi.Store', {
        model: 'User Story', 
        autoLoad: true,                         
        pageSize: 1000,
        filters : UserStoryFilter,

        listeners: {
            load: function(myStore, myData) {
                console.log(myData); 
            },
            scope: this                         
        },
        fetch: ['CreationDate','FormattedID', 'Name', 'PlanEstimate', 'Feature', 'PortfolioItem', 'Milestones','Parent','Children']
        });

1 个答案:

答案 0 :(得分:1)

你不能像你一样直接使用它,但你应该能够做类似的事情......

var filters = [
    {
        property: 'Iteration.StartDate',
        operator: '>=',
        value: '2018-05-01' //iso formatted iteration start date
    },
    {
        property: 'Iteration.EndDate',
        operator: '<=',
        value: '2018-06-30' //iso formatted iteration end date
    },
];