Duplicate dashboards for multiple support groups
With the limitation on the number of queues that can be created within SCSM, I have created a queue for each department ie. IT, HR, Finance, Facilities etc. and then just use the support group portal mapper to manage the team views within the portal.
The problem I have now is that the OOB Dashboards/Analytics is scoped to everything within the queue the user has access to and this is not ideal for managers that only wants to see only their support group stats.
To get around this, I have modified the SQL so that I can only pass in the support group name with the ('{{SuppGroup}}') token.
This works awesome and I can quickly create the required charts.
So now I have the daunting task of going into Navigation Settings and to create a page for all the support groups 30+, then going into those pages, creating the charts and only changing the support group token.
So here is my question:
Is there a way that I can create one page with all the required sharts and then duplicate that page to other pages.
This will allow me to only then go and change the token on each page and not create each page from scratch.
I hope this makes sense...
Anny help or suggestions will be highly appreciated.
Regards
Gerhard
Best Answer
-
Justin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭OK guys. I finally got this going! Keep in mind that URL parameters for dashboards will only work in 8.5+ of the portal. This little bit of custom code will let you create a single dashboard for all Incident Support Groups. You could easily add additional tables, charts, etc. As long as they're expecting the SupportGroup token, they'll change based on what's selected in the drop down.
@Tom_Hendricks - You might like this too.7
Answers
I have currently about 200 support groups and the list keeps growing, I had a one point a requirement to create a dashboard list for 97 level one groups that all the pages would be the same just the support group name is different.
How I accomplished this was to use SQL scripting to create many of the values. (Well my SQL engineer did this more so)
Use Case
One Dashboard page that contained 6 SQL widgets.
Create use case for 97 support groups to view their specific work items
Basically how we accomplished
I created one set SQL queries in the for the widgets in the admin setting Dashboard query settings.
Making sure to have a set structure of Name, Data source and query all where my support group can be uniquely identified from all other content in the columns.
Created one Navigation dashboard page and designed the page with the widgets using the SQL queries defined above.
So now I have one example I needed to build the other 96 desks against.
If you log into the ServiceManagement Database you will see that performing the above you will see new rows were added to tables dbo.Datasource for your 6 SQL widget queries
And one row in dbo.NavigationNode for the Dashboard page
So what we did to script it.
For the widgets SQL queries
Inserted new rows for each of the required widgets doing a replace in the query string of the support group. allowing the ID to be a auto gen GUID. This was a pretty easy one.
The NavigationNodes in testing we found we could not create the pages in SQL via script but in the portal we were able to create just a bunch of blank pages to have the populate correctly via the Cireson build process. That created a number of rows in the database and being blank the row Definition did not have much to it.
What my SQL engineer was able to do was script out updating the NavigationNode Definition of the one we did so all the blanks were updated to match while at the same time the values in the Definition were updated to the values created in the above widgets GUID values.
HTH to get you on the path how we got this accomplished.
"/Page/7a42acda-0256-4361-aab5-b68617e2eb00?SuppGroup=IT"
where the guid is the guid of your dashboard page. It's not dynamic or elegant, but it works. The next best step(as drawn out by Tom and @Geoff_Ross in that thread) is a fully custom page. I may still yet build a little POC though
@Tom_Hendricks - You might like this too.
My mutationobserver is a bit different in that I am actually checking the mutation itself to see if a newly added node has a matching, rather than running a search each time. That seems to help performance, particularly in IE--which I of course discourage people from using, but people are generally set in their ways. How does it run for you?
Step 1: add a SQL table widget to a page(it can be a new page if you like) and add a new query that accepts a token like this:
SELECT workitemid, title, ds.displaystring as 'SupportGroup'
FROM WorkItem w
LEFT JOIN DisplayString ds ON ds.elementid = w.tierid AND ds.localeid = 'enu'
WHERE ds.displaystring = '{{supportGroup}}'
Step 2:add an HTML widget to a page and add the div as the body (like the screenshot above: <div class='htmlwidgetdiv'></div/>)Step 3: save the page
Step 4: add the code from customDash.txt(above) to your CustomSpace/custom.js file making sure that the GUID on lines 20 and 30 matches the ID of the page selected(or created) on Step 1.