Ралли Кастом Канбан
Я хотел бы показать только истории / дефекты из текущей итерации на доске типов канбан, чтобы помочь с нашим процессом.
Итак, я нашел этот пример здесь на SO и добавил строку QUERY, чтобы отфильтровать мою итерацию. Но теперь я хочу, чтобы это пришло из выпадающего списка итераций, предоставленного Rally.
Я добавил его на экран, и он показывает нормально, но как мне подключить его к моему запросу?
<!DOCTYPE html>
<html>
<head>
<title>My Custom App</title>
<!--Include SDK-->
<script type="text/javascript" src="https://rally1.rallydev.com/apps/2.0p/sdk.js"></script>
<!--App code-->
<script type="text/javascript">
Rally.onReady(function() {
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
mappedToField:"State",
mappedFromField:"KanbanState",
fieldNameMap:{
a:"New",
b:"New",
c:"Defined",
d:"In-Progress",
e:"In-Progress",
f:"Completed",
g:"Completed",
h:"Accepted"
},
launch: function() {
this.add({
xtype:'rallyiterationcombobox',
itemId: 'iterationComboBox',
});
this.add({
xtype:'rallycardboard',
types: ["Defect", "HierarchicalRequirement"],
query: 'Iteration.Name contains "UB Sprint 29"',
attribute: this.mappedFromField,
listeners:{
beforecarddroppedsave:function(cardboard, card) {
//map the new state from on this card to the new state
var newState = this.fieldNameMap[card.record.get(this.mappedFromField)];
card.record.set(this.mappedToField, newState);
},
scope:this
}
});
}
});
Rally.launchApp('CustomApp', {
name: 'My Custom App'
});
});
</script>
</head>
<body class="myApp">
</body>
</html>
1 ответ
Решение
Если вы хотите фильтровать по итерации, вам нужно добавить прослушиватель в комбинированный список итераций, и он должен создать доску на основе текущей выбранной итерации.
<!DOCTYPE html>
Мой Канбан от Итерации
<!--Include SDK-->
<script type="text/javascript" src="https://rally1.rallydev.com/apps/2.0p2/sdk.js"></script>
<!--App code-->
<script type="text/javascript">
Rally.onReady(function() {
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
mappedToField:"State",
mappedFromField:"KanbanState",
kanban:undefined,
fieldNameMap:{
a:"New",
b:"New",
c:"Defined",
d:"In-Progress",
e:"In-Progress",
f:"Completed",
g:"Completed",
h:"Accepted"
},
launch: function() {
this.add({
xtype:'rallyiterationcombobox',
itemId: 'iterationComboBox',
listeners: {
select: this.createKanban,
ready: this.createKanban,
scope: this
}
});
},
createKanban:function(combo, records) {
if (this.kanban) {
this.kanban.destroy();
}
var filters = [];
if (records.length) {
filters.push({
property: 'Iteration',
value: records[0].get("_ref")
});
}
this.kanban = this.add({
xtype:'rallycardboard',
types: ["Defect", "HierarchicalRequirement"],
attribute: this.mappedFromField,
listeners:{
beforecarddroppedsave:function(cardboard, card) {
//map the new state from on this card to the new state
var newState = this.fieldNameMap[card.record.get(this.mappedFromField)];
card.record.set(this.mappedToField, newState);
},
scope:this
},
storeConfig:{
filters:filters
}
});
}
});
Rally.launchApp('CustomApp', {
name: 'My Kanban by Iteration'
});
});
</script>