2

Im trying to create a Cardboard in Rally to show Stories assigned to specific project (within a given release).

We use the project field to identify which of our three scrum team are working a specific story. I would like a board style display to allow me to move stories from team to team quickly, and to show a list of whats on each teams plate for a given release.

I came up with the following custom HTML App:

function cardboardOnLoad(cardboard, args) {
    var items = args.items;
    var itemsByType = cardboard.getItems(null, "Defect");
    var itemsByState = cardboard.getItems("Accepted");
    var itemsByTypeAndState = cardboard.getItems("Backlog", "Defect");
}

function onLoad() {
    var rallyDataSource = new rally.sdk.data.RallyDataSource('__WORKSPACE_OID__',
                          '__PROJECT_OID__', '__PROJECT_SCOPING_DOWN__');
    var cardboardConfig = {
        types : ["Defect", "HierarchicalRequirement"],
        attribute: "Project",
        fetch : "Name,FormattedID,Owner,ObjectID",
        query : 'Release.Name = "RI 3.1.0"',
        order : 'Rank'
    };

    var cardboard = new rally.sdk.ui.CardBoard(cardboardConfig, rallyDataSource);
    cardboard.addEventListener(cardboard.getValidEvents().onLoad, cardboardOnLoad);
    cardboard.display("cardboard");
}

rally.addOnLoad(onLoad);

Only Problems is that it doesn't actually show my stories... just the project column names...

It stories are shown if I change the attribute value to "ScheduleState", but not for "Project", and im not sure why...

Any help would be appreciated.

Thanks.

2
  • I'm not sure you can do this with the vanilla Cardboard. Project is an Object field, i.e. what you really want to map is Project.Name. However, in my testing, using that as an attribute doesn't work, i.e. the parsing of the cardboardConfig isn't setup to traverse to a child attribute of a member Object.
    – user984832
    Sep 11, 2012 at 23:26
  • I think I have an idea why it doesn't work. If you look at the data that is visible on any particular page, it is typically first filtered by the Project selection (top-left), so regardless if any cards show up for the project you've selected, the data is still constrained, such that it will not be able to access User Stories/Defects outside the universal set returned from that filter. This can definitely be a hindrance at times, and it'd definitely be nice if there was an option to build off the universal set, minus that initial selection, but it operates outside the realm of individual apps. Sep 12, 2012 at 14:50

1 Answer 1

0

This requires a slightly advanced usage of the cardboard where the columns are queried for manually. The comments above are correct in that you can run into some strange project scoping behavior otherwise.

The following app will build a board for all direct child projects of the currently scoped project.

Assuming you have a project hierarchy like so:

Project 1
+--Project 2
+--Project 3
+--Project 4

The board will contain columns Project 2, Project 3 and Project 4 when scoped to Project 1.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title>Release Project Board</title>
        <meta name="Name" content="Release Project Board" />
        <script type="text/javascript" src="/apps/1.32/sdk.js"></script>
        <script type="text/javascript">

            var rallyDataSource;
            var cardBoard;
            var releaseDropdown;

            function onLoad() {
                rallyDataSource = new rally.sdk.data.RallyDataSource('__WORKSPACE_OID__',
                   '__PROJECT_OID__',
                   '__PROJECT_SCOPING_UP__',
                   '__PROJECT_SCOPING_DOWN__');
                releaseDropdown = new rally.sdk.ui.ReleaseDropdown({}, rallyDataSource);
                releaseDropdown.addEventListener("onLoad", findProjects);
                releaseDropdown.addEventListener("onChange", onReleaseChanged);
                releaseDropdown.display("release");
            }

            function onReleaseChanged(rd, args) {
                var config = cardboard.getConfiguration();
                config.query = releaseDropdown.getQueryFromSelected();
                cardboard.refresh(config);
            }

            function findProjects() {
               rallyDataSource.find({
                   key: "projects",
                   type: "project",
                   query: new rally.sdk.util.Query('Parent = /project/__PROJECT_OID__'),
                   fetch: true
               }, onProjectsRetrieved);
            }

            function onProjectsRetrieved(results) {
                var columns = {};
                rally.forEach(results.projects, function(project) {
                    columns[rally.sdk.util.Ref.getRelativeRef(project)] = {
                        displayValue: project.Name 
                    };
                });

                var cardboardConfig = {
                    types : ["Defect", "HierarchicalRequirement"],
                    attribute: "Project",
                    fetch : "Name,FormattedID,Owner,ObjectID,Project",
                    query: releaseDropdown.getQueryFromSelected(),
                    columns: columns
                };

                cardboard = new rally.sdk.ui.CardBoard(cardboardConfig, rallyDataSource);
                cardboard.display("cardboard");
            }

            rally.addOnLoad(onLoad);

        </script>
    </head>
    <body>
        <div id="release"></div>
        <div id="cardboard"></div>
    </body>
</html>
1
  • Thats pretty much exactly what i wanted. Thanks Sep 13, 2012 at 22:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.