Filtering epics from Kanban board

前端 未结 3 1963
生来不讨喜
生来不讨喜 2021-01-27 01:31

I would like to start by saying I have read Rally Kanban - hiding Epic Stories but I\'m still having trouble on implementing my filter based on the filter process from the Estim

相关标签:
3条回答
  • 2021-01-27 01:36

    Mark's answer caused an obscure crash when cardboard.setItems(filteredItems) was called. However, since the filtering code is actually manipulating the actual references, it turns out that setItems() method is actually not needed. I pulled it out, and it now filters properly.

    0 讨论(0)
  • 2021-01-27 01:40

    Per Charles' hint in Rally Kanban - hiding Epic Stories

    Here's how I approached this following Charles' hint for the Rally Catalog Kanban. First, modify the fetch statement inside the cardboardConfig so that it includes the Children collection, thusly:

          fetch: "Name,FormattedID,Children,Owner,ObjectID,Rank,Ready,Blocked,LastUpdateDate,Tags,State"
    

    Next, in between this statement:

          cardboard.addEventListener("preUpdate", that._onBeforeItemUpdated);   
    

    And this statement:

         cardboard.display("kanbanBoard");
    

    Add the following event listener and callback:

        cardboard.addEventListener("onDataRetrieved", 
            function(cardboard, args){
                // Grab items hash
                filteredItems = args.items;
    
                // loop through hash keys (states)
                for (var key in filteredItems) {
    
                    // Grab the workproducts objects (Stories, defects)                 
                    workproducts = filteredItems[key];
                    // Array to hold filtered results, childless work products
                    childlessWorkProducts = new Array();
                    // loop through 'em and filter for the childless
                    for (i=0;i<workproducts.length;i++) {
                        thisWorkProduct = workproducts[i];                      
                        // Check first if it's a User Story, since Defects don't have children
                        if (thisWorkProduct._type == "HierarchicalRequirement") {
                            if (thisWorkProduct.Children.length === 0 ) {
                                childlessWorkProducts.push(thisWorkProduct);
                            }
                        } else {
                            // If it's a Defect, it has no children so push it
                            childlessWorkProducts.push(thisWorkProduct);
                        } 
                    }
                    filteredItems[key] = childlessWorkProducts;
                }
                // un-necessary call to cardboard.setItems() was here - removed
            }
        );
    

    This callback should filter for only leaf-node items.

    0 讨论(0)
  • 2021-01-27 01:58

    Not sure this is your problem but your cardboard config does not set the 'query' field. The fetch is the type of all data to retrieve if you want to filter it you add a "query:" value to the config object. Something like :

            var cardboardConfig = {
             types: ["PortfolioItem", "HierarchicalRequirement", "Feature"],
             attribute: dropdownAttribute,
             fetch:"Name,FormattedID,Owner,ObjectID,ClassofService",
             query : fullQuery,
             cardRenderer: PriorityCardRenderer
        };
    

    Where fullQuery can be constructed using the the Rally query object. You find it by searching in the SDK. Hope that maybe helps.

    0 讨论(0)
提交回复
热议问题