Importing knowledge into Service Manager 2010

Posted: 10th February 2010 by Anders Bengtsson in System Center Service Manager

This week I have tested to import knowledge into Service Manager. Knowledge can be used for example as guides in the self service portal for end-users, system documentation for engineers or troubleshooting guides for service desk personnel. One of the ways to get knowledge into Service Manager is to use the CSV import feature. The CSV import feature allows you to bulk-import instances of any class type or projection type defined in the Service Manager Configuration Management Database (SMCMDB). More info about CSV import here.

I started to map the labels on the knowledge form with properties of the knowledge class. When you use the CSV import feature you have one XML file with the properties that you will write data to and in which order they are, then you have a CSV file with the data itself.

Property Form label
Status Status (top left corner of the form)
Tag Flag article as
PrimaryLocaleID Language
Category Category
ArticleOwner ArticleOwner
Comments Comments
CreatedBy CreatedBy
VendorArticleID did not find this one
Title Title
Abstract Description
Keywords Keywords
ArticleId ArticleId
ExternalURLSource did not find this one
ExternalURL URL
AnalystContent Analyst Content
EndUserContent Internal Content

There are a couple of fields where you cant use normal display values, for example the status property, when you import knowledge articles you cant use “Draft” you will have to use “10F171DF-3AB1-648D-D151-D83A5171DD7B” in the CSV file. That is because the knowledge form use StringIds then there is a “translation table” in the database to translate the string into the correct work and language. So how do you get hold of these values?
They are all in the LocalizedText table in the Service Manager database. For example to get the StringID for draft status you can run the following query

SELECT [LTStringId]
,[LanguageCode]
,[LTStringType]
,[ManagementPackId]
,[ElementName]
,[MPElementId]
,[SubElementName]
,[LTValue]
,[TimeAdded]
,[LastModified]
,[DisplayStringId]
FROM [ServiceManager].[dbo].[LocalizedText] WHERE ElementName LIKE '%knowledge%status%draft%'

It will give you a result like this

As you can see there are different values for different languages. When you need to get StringIds for your values you will need to check in this table. During my test I found that you need to do this for status, tag and category.

There are two other intresting properties,  AnalystContent and EndUserContent. When you use these two with the CSV import feature is looking for files in the C:\Program Files\Microsoft System Center\Service Manager 2010 folder (default path). The content in these two files will be uploaded to the corresponding text field in the knowledge article form.

 
The following is a example of a CSV file and a XML file I used to import a knowledge article. If you save them to a folder and import them into Service Manager you will get a new knowledge article with some guidelines in each text field, so you easy can identify where to put your text.

10F171DF-3AB1-648D-D151-D83A5171DD7B,
F982E5B1-7864-7FC5-D0A4-8E000C91C241,75F786E2-CAA7-E7E9-47A0-BCC714BF1EDF,ArticleOwner,Comments,
CreatedBy,VendorArticleID,Title,Abstract,keyword,,
ExternalURLSource,http://www.contoso.se,
comment01.txt,comment02.txt

and the XML file used with the CSV file

Travis Wright in the Service Manager product team has written a good post with more info about this.

  1. Hi, I have not seen that, but I Think I have only been working with this at English customers. Is there a problem storing these characters if you update manual after import?

  2. Kenneth Sundby says:

    Nice article, helped me migrate our old KB to SM :)

    I ran into a small problem though, all the Norwegian characters (æøå) in the txt files were converted to ??’s…Tried a bunch of encodings but nothing seems to work…

  3. LordBOND says:

    I have my own class. It has two properties:
    1. Inventory number – text
    2. Member of the Active Directory – link.
    How do I write an xml file to import csv file? I want the user to Active Directory selected from Members of the Active Directory

  4. Is it possible to hide knowledge articles or are they always globally available?

  5. [...] If you need to update your users timezone and/or locale settings you could use the CSV connector. Travis has a good post about that here. I have a post about the CSV connector and importing knowledge here. [...]

  6. [...] this post I wrote about how-to import knowledge into Service Manager 2010. This week I did some tests [...]

  7. [...] http://www.contoso.se » Blog Archive » Importing knowledge into Service Manager 2010 Filed under: System Center, Service Manager [...]