将默认值传递给AddNew组件

时间:2012-06-25 02:04:09

标签: rally

我正在尝试预先填充创建缺陷弹出窗口,我不清楚我可以传递哪些键/值。文档说密钥应该是“名称”和“描述”,但它们没有被提取。然而,环顾四周之后,我注意到它正在拾取'defaultName'。 任何帮助表示赞赏!

`

       function onAddNewPreCreate(addNew, eventArgs)
       {
           eventArgs.item["defaultName"] = "name";
           eventArgs.item["Description"] = "description";
           eventArgs.item["defaultDescription"] = "description123";
       } 
       function onLoad() {

       var rallyDataSource = new rally.sdk.data.RallyDataSource('__WORKSPACE_OID__',
                 '__PROJECT_OID__',
                 '__PROJECT_SCOPING_UP__',
                '__PROJECT_SCOPING_DOWN__');

       var addNewConfig = {
         types : ["Defect"]
       };

       var addNew = new rally.sdk.ui.AddNewArtifact(addNewConfig, rallyDataSource);
      addNew.addEventListener('onPreCreate', onAddNewPreCreate);;
       addNew.display("addNewDiv");
   }

    rally.addOnLoad(onLoad);

`

1 个答案:

答案 0 :(得分:0)

不幸的是,AddNewArtifact(以及rally.sdk.util.Navigation.popupCreatePage)支持的字段列表没有详细记录。描述不是编辑器窗口中预填充所支持的字段之一。支持预填充的字段是:

User Story:
defaultName
rank
iteration
release
parent
dpyOid {dependency}

Defect:
defaultName
defectSuiteOid {Defect Suites}
testCaseResult
testCase
requirement
iteration

Defect Suite:
defaultName
rank
iteration

Portfolio Item:
defaultName
rank
parent

Task:
workProduct

Test Case:
testfolderOid {Test Folder}
artifactOid {Artifact}

Test Set:
iteration
release