-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserCreatedByUser-revHistory_example.html
More file actions
61 lines (52 loc) · 2.39 KB
/
UserCreatedByUser-revHistory_example.html
File metadata and controls
61 lines (52 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!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: User Created By" />
<meta name="Version" content="2010.4" />
<meta name="Vendor" content="Rally Labs, Nick M" />
<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('111111', '222222', //USER VALID OBJECTIDs FROM YOUR SUB
'false', 'false');
function itemQuery() {
var queryObject = {
key: 'u',
type: 'User',
fetch: 'UserName,RevisionHistory,Revisions,RevisionDescription,CreationDate,User',
query: '(UserName = someUser@company.com)', //USE VALID USERNAME
};
rallyDataSource.findAll(queryObject, populateTable);
}
function populateTable(results) {
var tableDiv = document.getElementById('aDiv');
var config = { columns:
[{key: 'RevisionDescription', header: 'Revision Description'},
{key: 'CreationDate', header: 'Creation Date'},
{key: 'UserName', header: 'User Name', width: 100},
{key: 'User', header: 'Created By'}] };
var table = new rally.sdk.ui.Table(config);
for ( i=0 ; i<results.u.length ; i++ ) {
for ( j=0 ; j<results.u[i].RevisionHistory.Revisions.length ; j++ ) {
if(results.u[i].RevisionHistory.Revisions[j].Description.indexOf("Original revision")>=0){
results.u[i].CreationDate = results.u[i].RevisionHistory.Revisions[j].CreationDate
results.u[i].RevisionDescription=results.u[i].RevisionHistory.Revisions[j].Description;
results.u[i].User=results.u[i].RevisionHistory.Revisions[j].User._refObjectName;
table.addRow(results.u[i]);
break;
}
}
}
table.display(tableDiv);
};
itemQuery();
}
rally.addOnLoad(tableExample);
</script>
</head>
<body>
<div id="aDiv"></div>
</body>
</html>