这是一个 AppSDK 1.33 示例:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta name="Name" content="App Example: Attribute Values" />
<title>Attribute Values Example</title>
<script type="text/javascript" src="https://rally1.rallydev.com/apps/1.33/sdk.js?apiVersion=1.43"></script>
<script type="text/javascript">
function attributeQueryExample() {
var showAttributeValues = function(results) {
var aDiv = document.getElementById("aDiv");
aDiv.innerHTML = '<b>attributeQueryExample</b><br>';
for (var property in results) {
aDiv.innerHTML += " <b>" + property + "</b><br>";
for (var i=0 ; i < results[property].length ; i++) {
aDiv.innerHTML += " " + results[property][i] + "<br>";
}
}
};
var queryConfig = [];
queryConfig[0] = {type: 'Hierarchical Requirement',
key : 'storyStates',
attribute: 'Schedule State'
};
queryConfig[1] = {type: 'Defect',
key : 'defectStates',
attribute: 'Schedule State'
};
var rallyDataSource = new rally.sdk.data.RallyDataSource('1111', '2222','false', 'false');
rallyDataSource.findAll(queryConfig, showAttributeValues);
}
rally.addOnLoad(attributeQueryExample);
</script>
</head>
<body>
<div id="aDiv"></div>
</body>
</html>
截图: