2

RallyWSAPI2.0p5を使用しています。JSONリターン

1つの応答で複数のテーブルからフィールドを取得しようとしています。これは可能ですか?たとえば、同じデータ応答でユーザーストーリーを取得し、Iteration.Stateも取得しようとしています。私はクライアントサイドを行うことが可能であり、それが唯一の方法である場合は知っています。誰かがテーブル(配列)を構築するために非同期応答を処理する方法を提供して例を挙げてもらえますか?

4

2 に答える 2

1

フェッチに含まれる属性のリストにStateを追加するだけです。RallyのWSAPIは、照会されるメインタイプにそのフィールドがない場合でも、サブオブジェクトの値を入力します。

launch: function() { 
    var userStories = Ext.create('Rally.data.WsapiDataStore', { 
        model: 'HierarchicalRequirement', 
        fetch: ['Iteration', 'State'], 
        autoLoad: true, 
        filters: [
            { 
                property: 'Iteration.State',
                value: 'Accepted' 
            }
        ], 
        limit: 10000, 
        listeners: { load: this._onDataLoaded, scope: this } 
    }); 
}
于 2012-11-17T23:16:22.983 に答える
0

私の元の質問のフォローアップとして。私は最近、RallyのWSAPIドキュメントでバッチクエリWSAPIのアルファリリースに出くわしました。バッチクエリを使用して、単一の応答で複数のオブジェクトモデルを取得することをお勧めします。

例として、ユーザーストーリーを取得し、単一のクエリで反復ステータスを取得します。

{
    "stories" : "/HierarchicalRequirement?fetch=Name,Iteration,State&query=(Iteration.State = Accepted)"
}

その結果、より使いやすく、サーバーへの複数のクエリを必要としません。すなわち

"Results": [{
        "_rallyAPIMajor": "1",
        "_rallyAPIMinor": "40",
        "_ref": "https://rally1.rallydev.com/slm/webservice/x/hierarchicalrequirement/xxxxxxxx.js",
        "_objectVersion": "17",
        "_refObjectName": "<user role> I would like <feature> for <benifit>",
        "Name": "As a <user role> I would like <feature> for <benifit>",
        "Iteration":             {
            "_rallyAPIMajor": "1",
            "_rallyAPIMinor": "40",
            "_ref": "https://rally1.rallydev.com/slm/webservice/x/iteration/xxxxxxxx.js",
            "_objectVersion": "4",
            "_refObjectName": "Sprint #",
            "Name": "Sprint #",
            "State": "Accepted",
            "_type": "Iteration"
        },
        "Project":             {
            "_rallyAPIMajor": "1",
            "_rallyAPIMinor": "40",
            "_ref": "https://rally1.rallydev.com/slm/webservice/x/project/xxxxxxxx.js",
            "_refObjectName": "Name",
            "_type": "Project"
        },
        "_type": "HierarchicalRequirement"
    },
    ....
    ]

詳細といくつかのリソースについては、以下をご覧ください。

于 2013-01-25T18:55:51.850 に答える