CA Rally - 如何获取子对象详细信息,例如从ProjectPermission获取项目详细信息

时间:2017-08-04 18:33:33

标签: javascript rally

我正在构建一个网格,用项目详细信息显示项目权限。

我可以使用

获取用户和项目权限详细信息
   Ext.create("Rally.data.wsapi.Store", {
                 model: "ProjectPermission",

但我无法获得项目详情。如何使用ProjectPermission获取项目detials ..

_.each(results, function(result) {

                 if (result.get("User").UserName) {

                     var permission = {
                         UserName: result.get("User").UserName,
                         DisplayName: result.get("User").DisplayName,
                         EmailAddress: result.get("User").EmailAddress,
                         ProjectName: result.get("Project")._refObjectName,
                         Role: result.get("Role"),
                         Disabled: result.get("User").Disabled,

                         Status: result.get("Project").State /*Not able to get this*/
                     };
                     permissions.push(permission)
                 }

真的很高兴你的帮助。

供参考,这是模型结构,需要使用_ref

获取项目详细信息
"ProjectPermission":{
"_rallyAPIMajor": "2",
"_rallyAPIMinor": "0",
"_ref": "https://rally1.rallydev.com/slm/webservice/v2.0/projectpermission/152079079u71479826p1",
"_refObjectUUID": "",
"_objectVersion": "0",
"_refObjectName": "LTC CS Portal Viewer",
"CreationDate": null,
"_CreatedAt": "today at 4:30 pm",
"ObjectID": null,
"ObjectUUID": "null",
"VersionId": "0",
"Subscription": null,
"CustomObjectID": "152079079u71479826p1",
"Name": "LTC CS Portal Viewer",
"Role": "Viewer",
"User":{
"_rallyAPIMajor": "2",
"_rallyAPIMinor": "0",
"_ref": "https://rally1.rallydev.com/slm/webservice/v2.0/user/152079079",
"_refObjectUUID": "6d44a99b-c235-45b7-b24e-add15e7108f8",
"_refObjectName": "Satish Pasala",
"_type": "User"
},
"Project":{
"_rallyAPIMajor": "2",
"_rallyAPIMinor": "0",
"_ref": "https://rally1.rallydev.com/slm/webservice/v2.0/project/71479826",
"_refObjectUUID": "91bac7a9-6fc3-4a90-9bb9-fa341e08dae5",
"_refObjectName": "LTC CS Portal",
"_type": "Project"
},
"Workspace": null,
"Errors":[],
"Warnings":[]
}
}

1 个答案:

答案 0 :(得分:0)

您应该只需将项目字段添加到您的提取中。从上面的评论看起来你想要状态吗?

fetch: [
    'Project', 
    'State', 
    //...other project fields here
]