【问题标题】:Rally Custom Kanban拉力赛定制看板
【发布时间】:2012-07-19 15:18:40
【问题描述】:

我只想在看板类型板上显示当前迭代中的故事/缺陷,以帮助我们的流程。

所以我在 SO 上找到了这个例子,并添加了 QUERY 行来过滤掉我的迭代。但现在我希望这来自于拉力赛提供的迭代下拉框。

我将它添加到屏幕上,它显示正常,但我如何将它实际连接到我的查询?

    <!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>

【问题讨论】:

    标签: rally kanban


    【解决方案1】:

    如果您想按迭代过滤,您需要向iteration combobox 添加一个侦听器,并让它根据当前选定的迭代创建板。

    <!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>
    

    【讨论】:

    • 谢谢查尔斯,我得到了这个工作:) 感谢你帮助我们。但是,当我完成这一切时,我没有像默认看板那样在卡片上出现缺陷/任务。我环顾四周寻找其他可能有的 CardConfig,但只看到了 rallyartifcatcard,它也没有显示它们。有没有办法使用拉力赛用来获取该信息的看板卡?再次感谢
    • 您正在查看的卡是用于 SDK 1.0 板的。 AppSDK 2.0 的下一个版本应该有一些更好的卡片功能。如果您不想自己复制它,可以等待我们完成发布。
    • 经过一番挖掘后,我实际上发现了这一点 :) 感谢您的帮助!
    • 我将此代码原样添加为自定义 html 应用程序,仅出现迭代下拉列表。
    猜你喜欢
    • 2012-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多