2013-07-25 2 views
1

로그인 키와 함께 Rally SDK 1.33을 사용하여 보고서 페이지를 만듭니다. 집회 밖에서 반복 요약 앱을 표시해야합니다.반복 요약 앱 집회 SDK

rallyDataSource.findAll({ 
      key: "sprints", 
      type: "Iteration", 
      query: '(EndDate > "today")', 
      fetch: true 
     }, displayIterationSummary); 

displayIterationSummary 기능은 다음과 같이 보일 것입니다 :

function displayIterationSummary(results) { 
      //access "Start Date" and "End Date" attribute from results.sprints to set up "DaysRemaining" and "TotalDays" 
      var panelConfig = { 
       title: "Sprint Summary", 
       columnKeys: ['Name', 'DaysRemaining', 'TotalDays', 'State'], 
       width: 600, 
       height: 300 

      }; 
      //take appropriate steps to display the result of this 

     } 

나의 생각은 내가 얻을 수 있다는 것입니다 나는 랠리의 반복에 대한 정보를 찾으려면 다음 사용하여이를 작성하려고했습니다 iteration "End Date"와 "Start Date"를 입력하고 그 속성을 사용하여 "Days Remaining"및 "Total Days"속성을 설정할 수 있습니다. 함수 "displayIterationSummary"에서 이러한 속성에 액세스하려면 어떻게해야합니까? 또한 랠리 외부에서 반복 요약 응용 프로그램을 작성하고 표시 할 수있는 다른 방법이 있으면 알려 주시기 바랍니다. 감사합니다.

답변

1

다음은 StartDate, EndDate 및 기타 데이터가 포함 된 반복 테이블을 인쇄하는 예입니다.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<!-- Copyright (c) 2010 Rally Software Development Corp. All rights reserved --> 
<html> 
<head> 
    <title>Table Component Example</title> 
    <meta name="Name" content="App Example: Table of Iterations" /> 
    <meta name="Version" content="2010.4" /> 
    <meta name="Vendor" content="Rally Lab - Nick" /> 
    <script type="text/javascript" src="https://rally1.rallydev.com/apps/1.33/sdk.js"></script> 
    <script type="text/javascript"> 

     function tableExample() { 
      var rallyDataSource = new rally.sdk.data.RallyDataSource('1111', '22222', 
      'false', 'true'); 
      function itemQuery() { 
       var queryObject = { 
        key: 'it', 
        type: 'iteration', 
        fetch: 'Name,ObjectID,Project,StartDate,EndDate', 
        query:'(EndDate > Today)' 
       }; 
       rallyDataSource.findAll(queryObject, populateTable); 
      } 

      function populateTable(results) { 

       for (var i=0; i < results.it.length; i++) { 
        results.it[i].Difference = rally.sdk.util.DateTime.getDifference(new Date(rally.sdk.util.DateTime. 
        fromIsoString(results.it[i].EndDate)),new Date(rally.sdk.util.DateTime. 
        fromIsoString(results.it[i].StartDate, "day"))); 
       } 

       var tableDiv = document.getElementById('aDiv'); 
       if(table) { 
        table.destroy(); 
       } 
       var config = { 
        columns: 
        [ 
         {key: 'Name'}, 
         {key: 'ObjectID'}, 
         {key: 'StartDate'}, 
         {key: 'EndDate'}, 
         {key: 'Difference'}, 
         {key: 'Project.Name'} 
        ] 
       }; 
       var table = new rally.sdk.ui.Table(config); 
       table.addRows(results.it); 
       table.display(tableDiv); 

      }; 
      itemQuery(); 
     } 

     rally.addOnLoad(tableExample); 
    </script> 
</head> 
<body> 
    <div id="aDiv"></div> 
</body> 
</html> 

랠리 외부에서 앱을 실행하려면. 직접 브라우저에서, sdk.js에 전체 URL이 필요합니다 :

<script type="text/javascript" src="https://rally1.rallydev.com/apps/1.33/sdk.js"></script> 

This document 랠리의 외부 응용 프로그램을 실행하기 위해 LoginKey를 사용할 필요가 없습니다 랠리 외부 응용 프로그램을 실행하는 방법에 대해 설명합니다. LoginKey 기능을 사용하면 읽기 전용 사용자의 자격 증명이 인코딩되어 있으므로 Rally에 로그인하라는 메시지가 표시되지 않고 사용자 지정 응용 프로그램이나 표준 보고서를 실행할 수 있습니다.

+0

맞습니다. 기본적으로 여기에서 한 작업을 수행하는 다른 테이블이 있습니다. 내가 알고 싶은 것은 populateTable 함수 안에서 StartDate와 EndDate의 차이를 얻는 것과 같은 작업을 수행 할 수 있으며 어떻게 든 테이블에 표시되도록 할 수 있습니까? – CW0lf

+0

예 : (중첩 루프에서) table.setCell (i, j, rally.sdk.util.DateTime.getDifference (new Date (results.sprints.EndDate)), new Date (results.sprints.StartDate), "day ")); // 물론 이것은 작동하지 않지만 바라는 것은 내가하려는 일을 볼 수 있습니다. – CW0lf

+1

"Difference"라는 열을 포함하도록 코드를 수정했으며 (아무 것도 지정할 수도 있음) for (var i = 0; i nickm