Defects By Priority

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.0 documentation.

This example demonstrates the integration of multiple components to create a basic app.
A table displays all defects and can be filtered using a drop-down list.

defect by priority

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">
<!-- Copyright (c) 2010 CA Agile Central Software Development Corp. All rights reserved -->
<html>
<head>
  <title>Defects By Priority Table Example</title>
  <meta name="Name" content="App Example: Defects by Priority" />
   <meta name="Version" content="2010.4" />
   <meta name="Vendor" content="CA Agile Central Software" />

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

     var table;
    var rallyDataSource = new rally.sdk.data.CA Agile CentralDataSource('__WORKSPACE_OID__',
'__PROJECT_OID__',
'__PROJECT_SCOPING_UP__',
'__PROJECT_SCOPING_DOWN__'
);
     function showTable(results) {
       if(table) {
        table.destroy();
       }
      var config = {
        columnKeys : ['FormattedID', 'Name', 'Priority', 'Severity'],
        columnWidths : ['100px', '300px', '200px', '100px'],
        width : '725px',
         height: '650px'
      };
      table = new rally.sdk.ui.Table(config);
       table.addRows(results.defects);
      table.display("defects");
     }

     function onSelectionChanged(sender, eventArgs) {

      var queryObject = {
        key : 'defects',
        type : 'defect',
        query: '(Priority = "' + eventArgs.value + '")',
        fetch: 'Name,FormattedID,Priority,Severity'
       };
       rallyDataSource.findAll(queryObject, showTable);
     }

     function onLoad() {
       var dpConfig = {
        type : "defect",
         attribute: "priority",
        defaultDisplayedValue: "Low",
         label: "Defect Priority:",
         showLabel: true
       };
       var dpDropdown = new rally.sdk.ui.AttributeDropdown(dpConfig, rallyDataSource);
       dpDropdown.display("priorityDiv", onSelectionChanged);
    }

    rally.addOnLoad(onLoad);

   </script>

</head>
<body>
   <div id="priorityDiv"></div>
   <div id="defects"></div>
</body>
</html>

Feedback

Need more help? The CA Agile Central Community is your one-stop shop for self-service and support. To submit feedback or cases to CA Agile Central Support, find answers, and collaborate with others, please join us in the CA Agile Central Community.