Stories by Iteration

Deprecation Warning! The content below is only applicable for use within deprecated 1.x versions of CA Agile Central's App SDK. Use of the component(s) and/or code on this page is not supported. To develop custom apps within our current environments, please see App SDK 2.1 documentation.

This example demonstrates the integration of multiple components to create a basic application. A table displays user stories scheduled in the iteration currently selected in the drop-down.

stories by iteration

Example Code

Copy and paste the following into a CA Agile Central custom page.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
   <title>User Stories By Iteration Example</title>
   <meta name="Name" content="App Example: User Stories Table" />

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

     var rallyDataSource = null;
     var iterDropdown = null;
    var table = null;

     function showUserStoriesTable(results) {
       var rankIx = 1;
      for (var i=0; i < results.stories.length; i++, rankIx++) {
         results.stories[i].Ranking = rankIx; // to get 1 through N rankings...
       }

       var tableConfig = {
         columnKeys : ['Ranking', 'FormattedID', 'Name' ],
         columnWidths : ['60px', '80px', '360px']
       };
       table = new rally.sdk.ui.Table(tableConfig);
       table.addRows(results.stories);
       table.display(document.getElementById('stories'));
     }

    function onIterationSelected() {
       if(table) {
        table.destroy();
       }
       var queryConfig = {
         type : 'hierarchicalrequirement',
         key : 'stories',
        fetch: 'Rank,FormattedID,Name',
         query: '(Iteration.Name = "' + iterDropdown.getSelectedName() + '")',
         order: 'Rank'
      };
       rallyDataSource.findAll(queryConfig, showUserStoriesTable);
     }

     function onLoad() {
       rallyDataSource = new rally.sdk.data.CA Agile CentralDataSource('__WORKSPACE_OID__',
                                    '__PROJECT_OID__',
                                    '__PROJECT_SCOPING_UP__',
                                    '__PROJECT_SCOPING_DOWN__');
      var iterConfig = {};
       iterDropdown = new rally.sdk.ui.IterationDropdown(iterConfig, rallyDataSource);
       iterDropdown.display(document.getElementById("iterationDiv"), onIterationSelected);
     }

     rally.addOnLoad(onLoad);
  </script>

</head>
<body>
  <div>
     <div id="iterationDiv"></div>
   </div>
   <br/><br/>
   <div id="stories"></div>
</body>
</html>

反馈

需要更多帮助? CA Agile Central 社区为您提供一站式自助和支持。要将反馈或支持请求提交到 CA Agile Central 支持、获取解答并与其他用户协作,请加入我们的 CA Agile Central 社区