Skip to content

Instantly share code, notes, and snippets.

@zspencer
Forked from nhajratw/gist:3783890
Created September 25, 2012 19:51
Show Gist options
  • Save zspencer/3784043 to your computer and use it in GitHub Desktop.
Save zspencer/3784043 to your computer and use it in GitHub Desktop.
accessing functions??
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
var id;
var inProgressDate;
var acceptedDate;
var cycleTime;
var kanbanState;
var calculcateCycleTime: function(acceptedDate, inProgressDate) {
var cycleTime = Math.round(Ext.Date.getElapsed(acceptedDate,inProgressDate) / 1000 / 60 / 60 / 24);
if (cycleTime === 0) cycleTime = 1;
return cycleTime;
}
Ext.create('Rally.data.WsapiDataStore', {
model: 'User Story',
autoLoad: true,
limit: Infinity,
listeners: {
load: function(store, data, success) {
Ext.Array.each(data, function(story) {
kanbanState = story.get('KanbanState');
if (kanbanState === 'Accepted') {
id = story.get('FormattedID');
inProgressDate = story.get('InProgressDate');
acceptedDate = story.get('AcceptedDate');
cycleTime = calculateCycleTime(acceptedDate, inProgressDate);
console.log('ID: ' + id + ' cycleTime: ' + cycleTime);
}
});
}
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment