我正在使用app SDK2.0。我有以下代码来检索特定迭代中项目的前100个团队成员的任务
//getting the first 100 elements of the owners Array
owners = Ext.Array.splice(owners,0,100);
//Initial configuration of the filter object
var ownerFilter = Ext.create('Rally.data.QueryFilter', {
property: 'Owner.DisplayName',
operator:'=',
value: owners[0]
});
/*Creating the filter object to get all the tasks for 100 members in that project*/
Ext.Array.each(owners,function(member){
ownerFilter = ownerFilter.or(
Ext.create('Rally.data.QueryFilter',{
property: 'Owner.DisplayName',
operator:'=',
value: member
}));
});
//Iteration Filter for the Object
var iterationFilter = Ext.create('Rally.data.QueryFilter', {
property: 'Iteration.Name',
operator:'=',
value: 'Iteration 4.2'
});
var filter = ownerFilter.and(iterationFilter);
Rally.data.ModelFactory.getModel({
type: 'Task',
success: function(model) {
var taskStore = Ext.create('Rally.data.WsapiDataStore', {
model: model,
fetch:true,
limit:Infinity,
pageSize:200,
filters:[filter],
autoLoad:true,
projectScopeDown:true,
listeners:{
load:function(store,data,success) {
Ext.Array.each(data, function(record){
console.log(record.data);
});
}
}
});
}
});
这段代码给了我一个413错误,因为查询的URL太large.The了,请求URL有100个project.How成员的名字,我能解决这个问题吗?是否有任何有效的过滤选项可用?
发布于 2013-02-02 00:08:17
团队成员资格是一个很难过滤工件的属性,因为它作为属性驻留在用户上,并且是一个不能在查询中使用的集合。
在这种情况下,您最好多做一些客户端的过滤工作。由于团队成员“近似”或关联到项目,因此您可能希望从过滤项目任务开始,即(Project.Name = "My Project")。然后,通过循环遍历并确保每个任务都归owners集合中的团队成员所有,从而缩小客户端的范围。
或者,您可能希望在您的任务中使用映射团队名称的标记。然后,您可以通过执行如下查询来过滤服务器端的任务:
(Tags.Name包含“我的团队”)
我知道这些不是理想的选择,也可能不是你想要的答案,但是,它们是一些可以避免构建大量基于用户名的查询的想法。
https://stackoverflow.com/questions/14649305
复制相似问题