How to integrate with Case (incident) in Dynamics CRM 2011

5 June 2013

Note: The Dynamics CRM User Interface uses the terminology ‘Cases’ but the underlying system calls them incidents Dynamics CRM is an excellent choice when managing service contracts but integrating the services process with other systems can be difficult. Essentially, the life-cycle of an case (incident) is:

  • Create the incident from an account or contact
  • Add several activities to the incident
  • Update the incident setting the status to closed / resolved

The above can be achieved from the Dynamics CRM user interface simply but the underlying architecture or how the incident moves between states is not quite as simple. In a perfect world we would assume that the following could easily be achieved by calling the following pseudo SDK calls:

  • Create Incident
  • Create Activities and associate them with the incident
  • Create a Close Incident Activity

Unfortunately, we need to apply some more details and steps to the solution rather than the standard Create, Update, Delete state changes:

  • Create Incident
  • Create Activities and associate them with the incident
  • Close Incident by sending specific Close Incident Message

Many other entities in Dynamics CRM 2011 have the same pattern of messages to change the state of the entity. Fortunately, Data Sync Studio will just call the special messages for you, so you can easily integrate you cases and incidents with 'no code', just using the simple click-click user interface and some excel type functions.

Using Data Synchronisation Studio to Create and Close Dynamics CRM Incidents with no code

Step 1. Connect to your source Service Desk system

At Simego we have an external ticketing system connected to the web, twitter, email etc. We are integrating this with Dynamics CRM and need to created historic as well as new tickets (incidents). We connect to our Service Desk SQL Database:

Connect

Browse through to the Tickets Table (we can just as easily define a SQL query as source)

Tables

Step 2. Connect to the target Dynamics CRM 2011 incident entity

Connect

Step 3. Map the required columns and use some Excel like functions to create the correct status codes and meta-data.

When creating an incident in Dynamics CRM you need to specify a contact or account to associate the incident to. We can use a 'Calculated Column' to quickly lookup the contactid from the contact entity based on a userid of the users stored externaluseridentifier column:

Calculated Column

We also can calculate the correct status mapping from the source system to status codes in Dynamics CRM. In this example is the Service Desk ticket status is 0 (open) then the statuscode of the incident needs to be set to 1 ('In Progress')else set the code to 5 ('Problem Solved').

Calculated Column

Step 4. Compare and synchronise

In this step DS3 calculates the differences between the Ticket table and the Incident entity, calculates a reconciliation and generates the Dynamic CRM inserts, Updates and Deletes. More importantly when we update the status of the incident (case) to closed it will automatically send the correct CloseIncidentRequest's to close the request. This allows our client's to choose when they close their tickets rather than our support team. This increases customer satisfaction as the support team cannot assume that an issue has been resolved satisfactorily. The client is in control of the call closure.

| |