So, you’re copying your incident action logs, analyst comment logs and user comment logs to the Data Warehouse (What?! You’re not? Then see this first).
Great, but how do you actually get these into a report and also in the correct order? Read on…
The above picture is an addition to the end of the standard Incident Detail Report. When creating new reports for Service Manager, it is easiest to copy an existing report that closely matches what you need.
Note – You should always work on a copy of a report and also on copies of any relevant Stored Procedures.
This way, you’ll not break the out-of-the-box functionality plus you’ll always have working reports and SPs to go back to if you mess up your new ones. If this is not possible or practical, then you should at least store unedited versions of the report rdl files, data sources and the stored procedures somewhere safe.
Having said this, to keep things simple, I am just going to show you how to edit the existing report
Therefore, please download a copy of your rdl first and save it somewhere so you can revert back if you need to.
Also, you’ll be adding a new Stored Procedure and not changing an existing one.
I’m assuming that your Data Warehouse database is called DWDataMart. If it is not, you’ll need to replace your database name in the instructions below and also change the SP code to “USE” the correct database.
I normally use SQL Server Business Intelligence Development Studio (SQL BIDS) to create and edit my reports, but, again for simplicity’s sake, I am going to use Report Builder 3.0.
Firstly, you need to create the new Stored Procedure:
Download the Stored Procedure text
This stored proc uses a temporary table to store all of the 3 log classes so they can be sorted into date order later.
If your Data Warehouse database is not called DWDataMart, change the USE statement on the first line.
Next, open SQL Server Management Studio (SSMS) and open a new query window on the DWDataMart database. Copy and paste the SP text you just downloaded into the query window and hit F5 to run and create a new Stored Procedure called “ServiceManager_Report_IncidentManagement_SP_GetIncidentLogs”.
Now you’ll need to grant permissions to run this SP to the ReportUser user. Open another new query window (or clear and reuse the existing one) and execute:
grant execute on ServiceManager_Report_IncidentManagement_SP_GetIncidentLogs to ReportUser
If you have setup additional report security, please grant any additional permissons that are required.
To edit the Incident Detail Report, browse to your SQL Server Reporting Services URL (for example, http://yourserver/reports). Don’t do this on your SQL Server! Why? It uses too many resources that are better used by SQL.
Then navigate your way down to the incident reports and right-click the detail report and select “Edit in Report Builder”.
If this the first time you have done this, allow Report Builder 3.0 to download and install.
On the Insert tab click Table\Table Wizard.
Select the option to Create a new dataset and click Next.
Select DWDataMart as the data source and click Next. Select credentials to connect to the data source (this does not update the data source). Either specify the password for the current stored credentials or use Windows Authentication if you have rights to do so.
Expand dbo\Stored Procedures, scroll down and find “ServiceManager_Report_IncidentManagement_SP_GetIncidentLogs” and tick it.
Order the columns up and down to your liking.
For the parameter IncidentId, just enter a 1 for now and click next.
Select the 3 available fields and drop them onto the Values area. Click Next and Next. Choose a style, slate is similar to the others but you can tweak later.
Click Finish.
Your new table will probably end up hovering somewhere near the top, so move it down to the bottom or wherever you want it. Widen the columns so you see the column headers and match the table width to your report. Change the column headers to say what you want.
Double-click your new data set on the right to edit it. Change the name if you like. Click on Parameters and set the value to use IncidentDimKey:
Confusion Alert! I called the parameter IncidentId but actually it is IncidentDimKey that needs passing
Lastly, this process has probably added an unwanted report parameter for IncidentId, check and remove it if needed:
Save your updated report. That’s it! Run the report and you should now see your action logs.
For a more advanced look at creating a new report check out this Microsoft post:
Woodgrove Report Example
Lastly, check through all of the various Stored Procedures in the DWDataMart database under “Programmabilty\Stored Procedures”. These will tell you how to do pretty much anything you need to create a new report, they are a great starting point.



this is great but i also want a report and this is very important
But in our scenario I want the report
• If single incident is assigned to three analyst let’s suppose analyst A, Analyst B, Analyst C
• If I am going to generate report for analyst it should be show on all three assigned incident report.
Probably you need a SQL DBA to construct the required SQL or Stored Procedure that generates the output your require, which can then be linked to a report. If you use the supplied reports and Stored Procedures as a starting point, you can normally work out how to do this. Also, the Data Warehouse and reporting forum might be of use here:
http://social.technet.microsoft.com/Forums/en/dwreportingdashboards/threads
Dear SCSM people,
How to add a company dimension/view in the standard reports?
I would like to use the SCSM standard incident management reports by company.
Unfortanetly the standard reports does not contain the possibility to create a view per company. The company field is part of the affected user table.
I’m wondering if there is an example how to customize the reports to include the company field? Any suggestions?
In my opinion a solution can be setting up a master data table with company information and connect this table to the user table.
At the end this must be integrated and customized in the datawarehouse too.
Looking forward to discuss this further!
Thanks in advance.
“Company” is in the view “UserDimVw” so you can just use something like this to get the company (very basic example, customise your report accordingly):
select i.id, i.title ,affecteduser.company
from incidentdimvw i
INNER JOIN dbo.WorkItemDimvw WI
ON I.EntityDimKey = WI.EntityDimKey
LEFT OUTER JOIN
dbo.WorkItemAffectedUserFactvw
ON dbo.WorkItemAffectedUserFactvw.WorkItemDimKey = WI.WorkItemDimKey
AND WorkItemAffectedUserFactvw.CreatedDate =
(
Select Max(CreatedDate) from WorkItemAffectedUserFactvw where WorkItemDimKey = WI.WorkItemDimKey
)
LEFT OUTER JOIN
dbo.UserDimvw AS AffectedUser
ON dbo.WorkItemAffectedUserFactvw.WorkItemAffectedUser_UserDimKey = AffectedUser.UserDimKey
Thanks Rob,
Do you have any idea if a customer masterdata table will be part of the SCSM datawarehouse roadmap?
Br, Guido
Sorry for the late reply, I have had time issues lately
The user comment log is used when a user uses the portal to add a comment.
Rob – Is there a way to create a stored procedure to take the review activity comments and manual activity notes in the same way you setup the incident stored procedure?