首页 > 解决方案 > Rally 2.1 SDK 过滤器故事功能

问题描述

我正在尝试过滤给定功能 ID 的用户故事,如下面的代码所示,但我没有得到任何结果。我已经尝试过 Feature.FormattdID 和 Feature.ObjectID ,但它没有获取该功能下的所有故事。使用功能 ID 过滤的正确方法应该是什么?

    <!DOCTYPE html>
<html>
<head>
    <title>Custom Store Grid Example</title>

    <script type="text/javascript" src="/apps/2.1/sdk.js"></script>

    <script type="text/javascript">
        Rally.onReady(function() {
          Ext.define('CustomApp', {
              extend: 'Rally.app.App',
              componentCls: 'app',

              launch: function() {
                var filters = [
             {property:'Feature.FormattedID',operator:'=',value: 'F1234'},
                          ];
                          Ext.create('Rally.data.WsapiDataStore',{
                              autoLoad: true,
                              model:'UserStory',
                              filters:filters,
                              listeners: {
                                  load: function(store,records,operation) {
                                      console.log('load store', store, records, operation);
                                  }
                              }
                          });
              },


              });
                Rally.launchApp('CustomApp', {
                  name: 'Custom Store Grid Example'
                });
            });
        </script>

        <style type="text/css">

        </style>
    </head>
    <body></body>
    </html>

标签: sdkrally

解决方案


这一切在我看来都是正确的。我的猜测是,您的隐式项目范围导致您的应用程序仅加载当前项目范围内的功能子项。如果您将上下文配置添加到您的商店以涵盖整个工作区,我敢打赌它会起作用:

context: {
    workspace: this.getContext().getWorkspaceRef(),
    project: null
}

推荐阅读