{"id":1285,"date":"2010-02-10T21:57:51","date_gmt":"2010-02-10T19:57:51","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=1285"},"modified":"2010-02-14T19:47:16","modified_gmt":"2010-02-14T17:47:16","slug":"importing-knowledge-into-service-manager-2010","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=1285","title":{"rendered":"Importing knowledge into Service Manager 2010"},"content":{"rendered":"<p>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.\u00c2\u00a0The 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 <a href=\"http:\/\/blogs.technet.com\/servicemanager\/archive\/2009\/05\/26\/using-the-csv-import-feature.aspx\">here<\/a>.<\/p>\n<p>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.<\/p>\n<table border=\"0\">\n<tbody>\n<tr>\n<td><strong>Property<\/strong><\/td>\n<td><strong>Form label<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Status<\/td>\n<td>Status (top left corner of the form)<\/td>\n<\/tr>\n<tr>\n<td>Tag<\/td>\n<td>Flag article as<\/td>\n<\/tr>\n<tr>\n<td>PrimaryLocaleID<\/td>\n<td>Language<\/td>\n<\/tr>\n<tr>\n<td>Category<\/td>\n<td>Category<\/td>\n<\/tr>\n<tr>\n<td>ArticleOwner<\/td>\n<td>ArticleOwner<\/td>\n<\/tr>\n<tr>\n<td>Comments<\/td>\n<td>Comments<\/td>\n<\/tr>\n<tr>\n<td>CreatedBy<\/td>\n<td>CreatedBy<\/td>\n<\/tr>\n<tr>\n<td>VendorArticleID<\/td>\n<td>did not find this one<\/td>\n<\/tr>\n<tr>\n<td>Title<\/td>\n<td>Title<\/td>\n<\/tr>\n<tr>\n<td>Abstract<\/td>\n<td>Description<\/td>\n<\/tr>\n<tr>\n<td>Keywords<\/td>\n<td>Keywords<\/td>\n<\/tr>\n<tr>\n<td>ArticleId<\/td>\n<td>ArticleId<\/td>\n<\/tr>\n<tr>\n<td>ExternalURLSource<\/td>\n<td>did not find this one<\/td>\n<\/tr>\n<tr>\n<td>ExternalURL<\/td>\n<td>URL<\/td>\n<\/tr>\n<tr>\n<td>AnalystContent<\/td>\n<td>Analyst Content<\/td>\n<\/tr>\n<tr>\n<td>EndUserContent<\/td>\n<td>Internal Content<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>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 &#8220;Draft&#8221; you will have to use &#8220;10F171DF-3AB1-648D-D151-D83A5171DD7B&#8221; in the CSV file. That is because the knowledge form use StringIds then there is a &#8220;translation table&#8221; in the database to translate the string into the correct work and language. So how do you get hold of these values?<br \/>\nThey 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<\/p>\n<p><code>SELECT [LTStringId]<br \/>\n,[LanguageCode]<br \/>\n,[LTStringType]<br \/>\n,[ManagementPackId]<br \/>\n,[ElementName]<br \/>\n,[MPElementId]<br \/>\n,[SubElementName]<br \/>\n,[LTValue]<br \/>\n,[TimeAdded]<br \/>\n,[LastModified]<br \/>\n,[DisplayStringId]<br \/>\nFROM [ServiceManager].[dbo].[LocalizedText] WHERE ElementName LIKE '%knowledge%status%draft%'<\/code><\/p>\n<p>It will give you a result like this<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/02\/SMImpKnowledge01.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-1305  aligncenter\" title=\"SMImpKnowledge01\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/02\/SMImpKnowledge01-300x30.jpg\" alt=\"\" width=\"300\" height=\"30\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/02\/SMImpKnowledge01-300x30.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/02\/SMImpKnowledge01-1023x104.jpg 1023w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/02\/SMImpKnowledge01.jpg 1259w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>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\u00c2\u00a0category.<\/p>\n<p>There are two\u00c2\u00a0other intresting properties, \u00c2\u00a0AnalystContent 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.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/02\/SMImpKnowledge02.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-1311  aligncenter\" title=\"SMImpKnowledge02\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/02\/SMImpKnowledge02-300x146.jpg\" alt=\"\" width=\"300\" height=\"146\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/02\/SMImpKnowledge02-300x146.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/02\/SMImpKnowledge02.jpg 807w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u00c2\u00a0<br \/>\nThe 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.<\/p>\n<p><code>10F171DF-3AB1-648D-D151-D83A5171DD7B,<br \/>\nF982E5B1-7864-7FC5-D0A4-8E000C91C241,75F786E2-CAA7-E7E9-47A0-BCC714BF1EDF,ArticleOwner,Comments,<br \/>\nCreatedBy,VendorArticleID,Title,Abstract,keyword,,<br \/>\nExternalURLSource,http:\/\/www.contoso.se,<br \/>\ncomment01.txt,comment02.txt<\/code><\/p>\n<p>and the XML file used with the CSV file<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/02\/SMImpKnowledge03.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-1319  aligncenter\" title=\"SMImpKnowledge03\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/02\/SMImpKnowledge03-300x295.jpg\" alt=\"\" width=\"300\" height=\"295\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/02\/SMImpKnowledge03-300x295.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2010\/02\/SMImpKnowledge03.jpg 310w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Travis Wright in the Service Manager product team has written a <a href=\"http:\/\/blogs.technet.com\/servicemanager\/archive\/2010\/02\/12\/importing-knowledge-into-service-manager-2010.aspx\">good post<\/a> with more info about this.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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.\u00c2\u00a0The CSV &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=1285\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[25],"tags":[],"_links":{"self":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1285"}],"collection":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1285"}],"version-history":[{"count":43,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1285\/revisions"}],"predecessor-version":[{"id":1328,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1285\/revisions\/1328"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1285"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}