1

I have been able to get the Java API code to work for Iteration TreeGrid and Iteration Burndown / Release Burnup charts. We have been trying to get this to work on Confluence and there are issues trying to pass just iframes and IT has issues with some of the bypass options. We have been able to get some semblance of this to work via the script below. In fact the Iteration TreeGrid works successfully everytime but most times the Standard Reports just present the Rally login screen. This is not consistent and sometimes this works for me in Chrome, but not in Firefox/IE etc. We have attache the API to the path of the confluence page if entered via link as well as what's in the script. Is there another method for key to passed for Standard Report to be able to generate?

Thanks! Mark

enter code here {html}

<script type="text/javascript">
    var field = 'apiKey';
    var url = window.location.href;
    if(
        (url.indexOf('?' + field + '=') != -1) ||
        (url.indexOf('&' + field + '=') != -1)
    ){
        //alert("**** 001");
    } else {        
        var myURL = document.location;
        if(window.location.href.indexOf('?') > 0){
            document.location = myURL + "&apiKey=_1OS4fhAQBi101VTZ4PytkQXb9jYEt0qYx79WXJacc";
        } else {
            document.location = myURL + "?apiKey=_1OS4fhAQBi101VTZ4PytkQXb9jYEt0qYx79WXJacc";
        }
    }

</script>


<div id="div-iterationburndown"></div>

    <script type="text/javascript">
        Rally.onReady(function() {
            Ext.create("Ext.Container", {
                context: {},
                items: [{
                    xtype: "rallystandardreport",
                    width: 750,
                    height: 500,
                    reportConfig: {
                        report: "IterationBurndown",
                        iteration: "April",
                        subchart: "hide",
                        title: "Iteration Burndown"
                    },
                    project: "https://rally1.rallydev.com/slm/webservice/v2.0/project/51186094804",
                    projectScopeUp: !1,
                    projectScopeDown: !0
                }],
                renderTo: Ext.get("div-iterationburndown")
            });


            Rally.launchApp('CustomApp', {
                name: "iterationburndown",
                parentRepos: ""
            });
        });
    </script>


<div id="div-releaseburnup"></div>

    <script type="text/javascript">
        Rally.onReady(function() {
            Ext.create("Ext.Container", {
                context: {},
                items: [{
                    xtype: "rallystandardreport",
                    width: 750,
                    height: 500,
                    reportConfig: {
                        report: "ReleaseBurnup",
                        subchart: "hide",
                        title: "Release Burnup"
                    },
                    project: "https://rally1.rallydev.com/slm/webservice/v2.0/project/51186094804",
                    projectScopeUp: !1,
                    projectScopeDown: !0
                }],
                renderTo: Ext.get("div-releaseburnup")
            });
            Rally.launchApp('CustomApp', {
                name: "releaseburnup",
                parentRepos: ""
            });
        });
    </script>

<div id="div-RallyGrid" style="border-width:5px 5px 5px 5px;width:300px;height:150px;"></div>

 <script type="text/javascript">
        Rally.onReady(function() {
            Ext.create("Rally.data.wsapi.TreeStoreBuilder").build({
                models: ["userstory"],
                autoLoad: !0,
                context: {
                    workspace: "https://rally1.rallydev.com/slm/webservice/v2.0/workspace/50876644101",
                    project: "https://rally1.rallydev.com/slm/webservice/v2.0/project/50891172431"
                },
                enableHierarchy: !0,
                filters: [{
                    property: "Iteration.Name",
                    operator: "=",
                    value: "April"
                }, {
                    property: "Project.Name",
                    operator: "=",
                    value: "Harrier"
                }]
            }).then({
                success: function(store) {
                    Ext.create("Ext.Container", {
                        width: 1e3,
                        height: 1e3,
                        border: 5,
                        items: [{
                            xtype: "rallytreegrid",
                            columnCfgs: ["DisplayColor", "Name", "ScheduleState", "Blocked", "TaskEstimateTotal", "TaskRemainingTotal", "Owner", "Notes"],
                            store: store
                        }],
                        renderTo: Ext.get("div-RallyGrid")
                    })
                }
            });
            Rally.launchApp('CustomApp', {
                name: "RallyGrid",
                parentRepos: ""
            });
        });
    </script>





{html}
markrosen
  • 91
  • 4

2 Answers2

0

StandardReport component in AppSDK2 is a wrapper over the first generation analytics service that predates ApiKey. This is the same analytics service that brings you reports on Reports>Reports page. Those reports were also available via StandardReport component in AppSDK1.

ApiKey is not supported in the first generation charts. AppSDK2 supports ApiKey as described in Embedding Apps guide. AppSDK2 apps can be authenticated with ApiKey. But if an AppSDK2 app is using a StandardReport component, the analytics service behind the report will prompt you to login - it does not work with ApiKey. In your scenario it unfortunately defeats the purpose of embedding the report within other web content to be viewed by stakeholders who may not necessarily have Rally credentials.

I suspect that if it seems that it works occasionally, it is probably because you are already logged in to Rally in another tab of the same browser window. If you open a new window in the incognito mode you will be prompted to login.

nickm
  • 5,936
  • 1
  • 13
  • 14
  • Thanks! Is there an AppsSDK2 complement to this that I missed or should leverage instead of the StandardReport component? I'm really trying to get the Confluence view of this type of report to work. Thanks! Mark – markrosen Apr 25 '16 at 13:19
  • There is no AppSDK2 equivalent of it. I don't like to refer you to a deprecated feature, but when using AppSDK1 with LoginKey you will not be prompted to login while embedding StandardReport. The reason they all work together is that they all predate AppSDK2 and ApiKey. https://help.rallydev.com/loginkey Also see: https://rallycommunity.rallydev.com/answers?id=kA1a0000000Yalc – nickm Apr 26 '16 at 00:18
0

Good news! The StandardReport component in AppSDK 2.1 and the backing A1 Analytics service now fully support Api Keys so you should be able to do this fairly easily.

Some useful links:

StandardReport component: https://help.rallydev.com/apps/2.1/doc/#!/api/Rally.ui.report.StandardReport

Embedding Apps externally: https://help.rallydev.com/apps/2.1/doc/#!/guide/embedding_apps

Kyle Morse
  • 8,390
  • 2
  • 15
  • 16