Rally SDK 2.0 JavaScript查询过滤
我正在尝试在我的用户故事中应用过滤器。但是过滤器不起作用,查询将返回所选项目中的所有故事 我正在使用以下代码:Rally SDK 2.0 JavaScript查询过滤,rally,Rally,我正在尝试在我的用户故事中应用过滤器。但是过滤器不起作用,查询将返回所选项目中的所有故事 我正在使用以下代码: var estimatedStoriesQuery = Ext.create('Rally.data.WsapiDataStore', { model: 'UserStory', storeConfig: { filters: [ {property: 'Project.Name',
var estimatedStoriesQuery = Ext.create('Rally.data.WsapiDataStore', {
model: 'UserStory',
storeConfig: {
filters: [
{property: 'Project.Name',
operator: '!=',
value: 'null'},
{property: 'PlanEstimate',
operator: '!=',
value: 'null'},
{property: 'ScheduleState',
operator: '=',
value: 'Accepted'},
{property: 'DirectChildrenCount',
operator: '=',
value: '0'},
{property: 'AcceptedDate',
operator: '<',
value: 'LastMonth'}
]
},});
estimatedStoriesQuery.load({
callback: function(records, operation) {
if(operation.wasSuccessful()) {
var estimatedStoriesCount = records.length;
document.write(estimatedStoriesCount);
}
}
});
var estimatedStoriesQuery=Ext.create('Rally.data.WsapiDataStore'{
模型:“用户故事”,
storeConfig:{
过滤器:[
{属性:'Project.Name',
运算符:“!=”,
值:'null'},
{属性:'planeEstimate',
运算符:“!=”,
值:'null'},
{属性:“ScheduleState”,
运算符:'=',
值:'已接受'},
{属性:'DirectChildrenCount',
运算符:'=',
值:'0'},
{属性:“AcceptedDate”,
运算符:“您有一个额外的嵌套storeConfig。去掉它,您应该会很好:
var estimatedStoriesQuery = Ext.create('Rally.data.WsapiDataStore', {
model: 'UserStory',
filters: [
{property: 'PlanEstimate',
operator: '!=',
value: 'null'},
{property: 'ScheduleState',
operator: '=',
value: 'Accepted'},
{property: 'DirectChildrenCount',
operator: '=',
value: '0'},
{property: 'AcceptedDate',
operator: '<',
value: 'LastMonth'}
]
});
var estimatedStoriesQuery=Ext.create('Rally.data.WsapiDataStore'{
模型:“用户故事”,
过滤器:[
{属性:'planeEstimate',
运算符:“!=”,
值:'null'},
{属性:“ScheduleState”,
运算符:'=',
值:'已接受'},
{属性:'DirectChildrenCount',
运算符:'=',
值:'0'},
{属性:“AcceptedDate”,
运算符:“您有一个额外的嵌套storeConfig。去掉它,您应该会很好:
var estimatedStoriesQuery = Ext.create('Rally.data.WsapiDataStore', {
model: 'UserStory',
filters: [
{property: 'PlanEstimate',
operator: '!=',
value: 'null'},
{property: 'ScheduleState',
operator: '=',
value: 'Accepted'},
{property: 'DirectChildrenCount',
operator: '=',
value: '0'},
{property: 'AcceptedDate',
operator: '<',
value: 'LastMonth'}
]
});
var estimatedStoriesQuery=Ext.create('Rally.data.WsapiDataStore'{
模型:“用户故事”,
过滤器:[
{属性:'planeEstimate',
运算符:“!=”,
值:'null'},
{属性:“ScheduleState”,
运算符:'=',
值:'已接受'},
{属性:'DirectChildrenCount',
运算符:'=',
值:'0'},
{属性:“AcceptedDate”,
操作员:“抱歉,但它仍然不起作用。我是否正确加载了查询?或者是否正确地计算了故事数?此代码似乎对我起作用。您希望得到什么?过滤器以书面形式返回所有接受的叶故事,这些叶故事包含上个月之前接受的PlanEstimate集。这就是您想要的吗?”尝试?未满足
if(operation.wassuctive())
条件。是否知道?如果在浏览器的开发人员工具中打开“网络”选项卡,是否可以检查请求和响应?是否返回错误?代码有两个问题:1)根据Kyle的回答,请删除嵌套的存储配置请注意,Kyle的代码在config.2中没有storeConfig)使用2.0rc1版本的sdk而不是2.0p4。DirectChildrenCount在2.0p4中不可用。在我做了这两个更改后,您的代码工作正常。抱歉,但它仍然不工作。我是否正确加载查询?或者是否使用了正确的方法来计算故事数?此代码似乎对我有效。您希望得到什么?作为wri的筛选器t返回所有在上个月之前已接受的具有PlanEstimate集合的已接受的叶子故事。这就是您要尝试的吗?如果(operation.wassuctive())条件未满足。有什么想法吗?如果在浏览器的开发人员工具中打开“网络”选项卡,可以检查请求和响应吗?返回任何错误吗?代码有两个问题:1)根据Kyle的回答,请删除嵌套的存储配置(它仍在代码中)。请注意,Kyle的代码在配置中没有storeConfig。2)使用2.0rc1版本的sdk而不是2.0p4。DirectChildrenCount在2.0p4中不可用。在我做了这两个更改后,您的代码工作正常。