none
How to import text as analayst comment to mass import of Incidents

All replies

  • This is what im starting with.

    <CSVImportFormat> <Projection Type="System.WorkItem.Incident.ProjectionType"> <Seed> <Class Type="System.WorkItem.Incident"> <Property ID="Id"/> <Property ID="Title"/> <Property ID="Urgency"/> <Property ID="Impact"/> <Property ID="Classification"/> <Property ID="Description"/> <Property ID="TierQueue"/> <Property ID="Source"/> </Class> </Seed> <Component Alias="AffectedUser"> <Seed> <Class Type="System.Domain.User"> <Property ID="UserName"/> <Property ID="Domain"/> </Class> </Seed> </Component> <Component Alias="AnalystComments"> <Seed> <Class Type="System.WorkItem.TroubleTicket.AnalystCommentLog"> <Property ID="Id"/> <Property ID="Comment"/> </Class> </Seed> </Component> </Projection> </CSVImportFormat>

    And the error message i get:

    Error: Could not import the row on line 1 of CSV file C:\working_directory\CSV imports\Work items\incidents\Live_Incidents.test.csv. Object creation failed with the following error:

    --> Exception of type 'Microsoft.EnterpriseManagement.CSVImport.CSVInstanceException' was thrown.

    Monday, September 17, 2012 3:39 PM
  • Hi,

    I have been using this XML recently to migrate analyst comments.

    <CSVImportFormat>
    	<Projection Type="System.WorkItem.Incident.ProjectionType">
    		<Seed>
    			<Class Type="System.WorkItem.Incident">
    				<Property ID="Impact" />
    				<Property ID="Urgency" />
    				<Property ID="Id" />
    			</Class>
    		</Seed>
    		<Component Alias="AnalystComments">
    			<Seed>
    				<Class Type="System.WorkItem.TroubleTicket.AnalystCommentLog">
    					<Property ID="Comment" />
    					<Property ID="EnteredBy" />
    					<Property ID="EnteredDate" />
    					<Property ID="Id" />
    					<Property ID="DisplayName" />
    					<Property ID="IsPrivate" />
    				</Class>
    			</Seed>
    		</Component>
    	</Projection>
    </CSVImportFormat>

    • Proposed as answer by Herb Winhoven Tuesday, April 09, 2013 8:21 PM
    Wednesday, September 19, 2012 4:40 PM
  • Thanks Dieter, will give that a try
    Thursday, September 20, 2012 7:42 AM
  • Hi Dieter,

    It worked when i used it once just creating 1 new incident to see if the import of the comment would work.

    It created a new incident with the comments added. Thanks

    However when i try to add a new incident and just changed the comments i get the below error.

    Error: Could not import the row on line 1 of CSV file C:\working_directory\CSV imports\Work items\incidents\Live_Incidents.test.csv. Object creation failed with the following error:

    --> Exception of type 'Microsoft.EnterpriseManagement.CSVImport.CSVInstanceException' was thrown.

    <CSVImportFormat>
    	<Projection Type="System.WorkItem.Incident.ProjectionType">
    		<Seed>
    			<Class Type="System.WorkItem.Incident">
    				<Property ID="Id"/>
    				<Property ID="Title"/>
    				<Property ID="Urgency"/>
    				<Property ID="Impact"/>
    				<Property ID="Classification"/>
    				<Property ID="Description"/>
    				<Property ID="TierQueue"/>
    				<Property ID="Source"/>
    			</Class>
    		</Seed>
    	  <Component Alias="AffectedUser">
    			<Seed>
    			<Class Type="System.Domain.User">
                           	<Property ID="UserName"/>
    			 <Property ID="Domain"/>
    			</Class>
    			</Seed>
    		</Component>
    	 	<Component Alias="AnalystComments">
    			<Seed>
    				<Class Type="System.WorkItem.TroubleTicket.AnalystCommentLog">
    					<Property ID="Comment" />
    					<Property ID="EnteredBy" />
    					<Property ID="EnteredDate" />
    					<Property ID="Id" />
    					<Property ID="DisplayName" />
    					<Property ID="IsPrivate" />
    				</Class>
    			</Seed>
    		</Component>
    	</Projection>
    </CSVImportFormat>

    Thursday, September 20, 2012 9:11 AM
  • Great work!  I am doing something very similar but dont understand the file attachments portions.  If you have a moment please check this out; I have no idea how it is supposed to know the location of the attachments themselves as I cant find a property that says something like:

    <Property ID="FileLocation" />

    All I have is this but am certain I am missing the file location property:

        <Component Alias="FileAttachments">
          <Seed>
            <Class Type="System.FileAttachment">
              <Property ID="Id" />
            </Class>
          </Seed>
          <Component Alias="FileAttachmentAddedBy">
            <Seed>
              <Class Type="System.Domain.User">
                <Property ID="Domain"/>
                <Property ID="UserName"/>
              </Class>
            </Seed>
          </Component>
        </Component>

    Thursday, March 21, 2013 8:05 PM
  • I don't think you can do file attachments through CSV import.  You can add RTF content to knowledge articles by pointing to an RTF file, but I don't think we have support for file attachments.

    Travis Wright, Principal Program Manager, Microsoft

    Friday, March 22, 2013 6:05 AM
    Owner
  • Did you change the AnalystCommentLog.Id property value?  If not you probably hit a unique value constraint because the Id property is the key property of the AnalystCommentLog class. You'll need to provide a unique Id value for every comment.  Even comments contained by different incidents need to have unique values.

    Travis Wright, Principal Program Manager, Microsoft

    Friday, March 22, 2013 6:07 AM
    Owner
  • There must be support because this syntax comes straight from:

    http://blogs.technet.com/cfs-filesystemfile.ashx/__key/communityserver-components-postattachments/00-03-24-59-75/AppendixA.html#b0a81125-c160-f3a4-4eea-a9d89e26c8d6

    Also, the blog that gave me this link has the detailed instructions on importing into SCSM via CSV and uses the above syntax as an example but fails to include the part about file location.

    Friday, March 22, 2013 2:25 PM
  • How are you getting around the comment that have commas in them?  It seems like that would mess up the CSV.  Use another delimiter or must it be comma delimited?
    Friday, March 22, 2013 4:37 PM
  • John,

    we have imported comments via Orchestrator successfully, so if you dont get any further with CSV import let me know.R.


    Problem talk creates problems, solution talk creates solutions (Steve deShazer)

    Friday, March 22, 2013 5:17 PM
  • I am having the same problem as John.

    Microsoft.EnterpriseManagement.Common.InvalidSimpleObjectValueException

    Friday, March 22, 2013 5:35 PM
  • Confirmed, Travis is right in that Each agent comment requires its own ID.
    Friday, March 22, 2013 7:54 PM