Rally 2.1 SDK - Фильтрация пользовательских историй по итерациям - PullRequest
0 голосов
/ 01 июня 2018

Можно ли фильтровать пользовательские истории на основе итераций между начальной и конечной итерацией.Я могу отфильтровать все пользовательские истории от начала итерации до конца и до конца, но я получаю ошибку, когда использую фильтр «.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 голосов
/ 01 июня 2018

Вы не можете использовать его напрямую, как вы, но вы должны быть в состоянии сделать что-то подобное ...

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
    },
];
...