2013-02-01 27 views
2

我使用的應用程序SDK 2.0.I有下面的代碼來獲取該項目的第一個100個團隊成員的任務特定迭代413錯誤滿頭查詢網址過大拉力

   //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); 
           }); 
          } 
         } 

        }); 

       } 
      }); 

此代碼是因爲查詢的URL太大,所以給我一個413錯誤。請求URL中包含所有100個項目成員的名稱。如何解決此問題?是否有任何有效的過濾選項可用?

回答

0

團隊成員資格是過濾工件的一項艱難屬性,因爲它作爲用戶的屬性駐留,並且是不能在查詢中使用的集合。

在這種情況下,您可能最好做更多的客戶端過濾。由於團隊成員「接近」或與項目關聯,您可能希望從項目過濾您的任務,即(Project.Name =「我的項目」)。然後通過循環來縮小客戶端的範圍,並確保每個任務由您的所有者集合中的團隊成員擁有。

或者,您可能會嘗試在您的任務上使用鏡像團隊名稱的標籤。

(Tags.Name包含「我的團隊」)

我知道這些都不是理想的選擇,可能不是答案您正在尋找:然後,你可以做一個查詢,如過濾你的任務服務器端因爲,但是,他們是一些想法,以避免必須建立一個龐大的基於用戶名的查詢。