Friday, June 7, 2013

Importing Data (Incident Record) to Service Manager 2012 using CSV - Part 1

Over the weekend I got my chance (FINALLY !) to test out the method of importing data into Service Manager 2012. Why would I spent my time to look into this ? Well there are a few reason I can tell:

  1. Customer wants to migrate to Service Manager from existing IT SM tool
    • Not all organisation wants to let go their old data.
    • Comply with audit policy which at least 7 years. Can't expect to keep the current IT SM tool for 7 years to come.
    • Reporting, analysis and KPI trending. CIO, Director and Manager wants to see continuous trend of their service. How can they accept the fact to start from SCRATCH ? you might well just kill them - just kidding.
  2. Engineer like us wants to pump in data for testing
    • For Demo purpose. We don't want to talk only about the tool, we must be able to show it, right ?
    • Huge amount of data. We must be able to bulk create a huge amount of data before we can see the trend. Especially when we want to show the reporting part of the tool.
Lets See some of the things that should be prepared:
  1. A running Service Manager 2012 Management Server.
  2. Microsoft Excel - On your desktop for CSV file creation
  3. XML Editor - Properly you may need a good XML editor to create XML file for SM. You can survive with Notepad if you don't have one :-P.
  4. A copy of CSVImport.docx.
  5. A copy of ApendixA.html
  6. Someone (you) who knows Service Manager fundamental :-P
Useful Resources:
Using a CSV File to Import Data into Service Manager - A useful Technet article that talks about importing data to Service Manager using CSV.

XML Notepad - A XML editor by Codeplex. It safed my life before in Editing SM Management pack. It could safe yours :-P

Let's get started. In this blog, I will be importing Incident Record (IR) to Service Manager. Importing data into SM require 2 files. These are the XML and CSV. The XML file will be the the "header" (in that sense) for all the data in CSV that you going to pump in SM.

Overview of ApendixA.html
In order to get the correct syntax and sequent that the SM could understand, you must refer to ApendixA.html.

Since my objective is to import incidents, my interest in ApendixA will be on System.WorkItem.Incident.
Those field in RED indicates mandatory field. From here, it gives you an idea of the nature of the variable.
When you scroll a little down, you will now see the format. This is what you will be using to create the XML file of you own choice.
Preparing XML File
As for my first testing, I will just go with minimum data and item. Below is my XML file for first try.

Preparing CSV File
Now I got the XML file, the next task is to create a CSV file that reflects the XML structure with the data that you want to import. Microsoft Excel will be you best friend here.

The line contains below:
Id IR2
Urgency System.WorkItem.TroubleTicket.UrgencyEnum.High
Impact System.WorkItem.TroubleTicket.ImpactEnum.High
Source IncidentSourceEnum.Phone
Status IncidentStatusEnum.Active
TierQueue IncidentTierQueuesEnum.Tier1
Classification IncidentClassificationEnum.Email
Title Unable to send email
Description Email stuck in Microsoft Outlook client
ContactMethod E-Mail
1/5/2013 6:00
Displayname Unable to send email

Importing the Information to Service Manager
Launch SM Console and select Administration from the Workspace on the right
Select Connector at the Explorer Pane, and at the Action Pane, select Import from CSV file.

Select the XML and CSV files you have created earlier.

Once you click Import, SM will process both files and proceed with the import.

Now, let take a look at the data that is imported.

Verifying the Imported IR
Take a look of all the information provided.

So now you can import data into Service Manager and this will be extremely helpful when you come across project requirement to migrate data from existing ITSM tool.

You may be wonder by now how about other field such as Affected User, Created by User, Assigned by User and Resolved by User ?

Please stay tune to Part 2 as I will be showing you larger data to be imported into Service Manager.

Post a Comment