Create incidents based on a CSV file

Today I needed to generate incidents based on a CSV file that a external system generated. There are a couple of different ways to do it, but one simple way is to use the Service Manager PowerShell cmdlets that Patrik wrote. In my example I have a CSV file that looks like

I then have a PowerShell script that looks like

The PowerShell script read the CSV file and generate one incident for each line. BF261F09-5FAD-EEA4-24CE-1DA889CEF381 is the LTValue for category “Printing Problem”. For default list values you can use friendly name but for all custom values you need to use the GUID. To get the GUID you need to query the ServiceManager database. You can run the following query to find the GUID for Printing Problems.

FROM [ServiceManager].[dbo].[LocalizedText] WHERE LTValue LIKE '%Printing%'

Update: If you need to import incidents that includes "," in for example the description, add "" around the whole description part in the CSV file. For example Incident Title 11,"Description including a , 02 here",Medium,Medium,BF261F09-5FAD-EEA4-24CE-1DA889CEF381,System

6 thoughts on “Create incidents based on a CSV file

  1. Hello, Anders.
    I work for an IT consultant company and we’re starting our works around Service Manager. Installing some test environments and doing some initial tests.
    But one thing I can’t find documentation about, and my environment isn’t mature enough for it yet, is related to incident categorization.
    How many levels of categorization is possible to be implemented in Service Manager? Obviously too many categories will only make the analysts job harder, and won’t stick to the process due to complications. But it would be very interesting to know how many levels are possible on the incident categorization.
    Also, have you find anything related to the solution categorization yet? It is related to searches on the knowledge base, correct? The product can provide searches on the KB “out-of-the-box”? Does it follow the same categorization implemented on the Incident creation or does it have to be categorized in a different way?
    Thanks a lot for your help. Have a nice day!

Leave a Reply

Your email address will not be published. Required fields are marked *