It's all about the answers!

Ask a question

cannot create dashboard templates with parametrized queries

Miguel Tomico (5001022) | asked Nov 25 '14, 9:37 a.m.
edited Nov 25 '14, 9:45 a.m.

There are some related topics here in but I haven't found a specific one with the following issue we are experiencing:

We use the Work Items Statistics viewlet pointing to queries with parameters. We can manually create those widgets by selecting the query and the proper parameters. The problem is, we cannot populate them automatically when the project is created by using dashboard templates. There seems to be nothing to set up parameters in Project Configuration -> Configuration Data -> Dashboards -> Dashboards templates.

The reason it is so important to find a way to automate it is because we have many Team Areas (50+) and many iterations (10+). We configure a dashboard for every Team Area. Every dashboard contains a tab for every Iteration with 10 Work Item Statistics widgets pointing to queries with parameters. This makes 50 * 10 * 10 = 5000 widgets to be configured manually every time a Project Area is created. It takes weeks.


Any idea how to populate them programmatically? Maybe using the client Java API? exporting the widgets to HTML, editing the contents with the proper parameters and find a way to create or modify the widgets with that new HTML?

Any help will be highly appreciated.

3 answers

permanent link
sam detweiler (12.5k6184201) | answered Nov 25 '14, 9:53 a.m.
the api for dashoards is not documented..   I spent a bunch of time looking at this early in the year, but came away unsuccessful.  Mostly I was missing functions to READ the values without actually presenting them.  the only way to figure this out is to read the product source code provided in the SDK, but the object model is so deep its a challenge to see it all. (for me at least)

permanent link
Miguel Tomico (5001022) | answered Nov 26 '14, 5:28 a.m.
Thank you, Sam.
I have open a work item, as RTC is displaying a non-comprehensive error message when using queries with parameters, and it is unclear in the documentation if they can be used (maybe using mementos?) or not.

permanent link
Miguel Tomico (5001022) | answered Dec 04 '14, 4:46 a.m.
Found some interesting links which clarify what's behind widgets. (see Mike Pawlowski' comment).

Following above instructions, we have discovered:
- When having widgets (i.e. Work Items Statistics) pointing to queries with parameters, exporting the widget to HTML will reveal the queryParams parameter as a Preference. This will enable us to enter this info in the dashboard template. Great!

Not so fast. In most of the cases, the values of those parameters will be UUIDs of the correspondent elements, so we need to get the actual values once the Project Area has been created.
We can create the project area and build the Dashboard XML template replacing texts with the actual values by using the RTC client Java API, and then restore the Project Area dashboard with the Dashboard template.

Providing the parameters for other types of widgets, such as custom reports (BIRT) will be similar, but these particular ones (custom reports) store the parameters as mementos, and they are not visible when the widget is exported to HTML. It requires to inspect the POST call by using FireBug, as explained in above URLs.

It is a bit tedious, but it seems to work beautifully, and it can save weeks of manual repetitive work to customers like us having thousands of widgets.

The only drawback (and it is a big drawback) I have found is the Scope of the dashboards. In particular, I'm struggling with the Team Area dashboards.
As expected, the content of the Team Area dashboards have the selected Team Area as a parameter in most widgets, so we will need a variable to store the UUID of the selected Team Area.
The funny thing is ${scope} will give us the Name of the Team Area, so we are very very close, but I have no clue if there is another variable to retrieve the UUID.

Sorry for such a detailed and technical post.
I guess my questions are more for jazz developers than for regular users :-(

Your answer

Register or to post your answer.