Step 4: How to import old cases into your Salesforce integration

Last Updated -

How to bring your existing cases over to Salesforce

You've just setup your Desk to Salesforce integration and now would like to bring over all of your existing cases into the related list within Salesforce. You can  accomplish this task using a custom case field that will tell the system that you want to send a case to Salesforce; a label to indicate that the case has been sent to Salesforce;  and a time rule to automatically flag the cases to send to Salesforce; and a  case updated rule to execute the webhook and actually send the cases to Salesforce.

So let's get started with the Custom Case Field.

  1. Go to the Admin Panel → Cases → Cases → Custom Fields.

  2. Click on the Add Field  button to add a field:


  3. Name it "Push To SF" and make it a True/False field. Then click Add:​​Note: If you are using the system default Case Layout/Theme then the field will show up automatically but if you are using a Custom Case Theme then you will need to add this field to your theme.

  4.  Go to the Admin Panel → Cases → Labels.

  5.  Click on the Add Label button to add a label.

  6. Name it "push to sf", then click Add.

  7. Now that we have created our custom field and label, we are going to use them in our rules. Go to the Admin Panel → Cases → Rules → Cases Updated. Find the "Update Case in Salesforce" Rule and click on the cog on the right hand side to edit the rule:​​​

  8. We are going to add two new conditions to the rule.The first one is "Case Interaction Count" "has changed", this will indicate that something has happened to the case.The second one is "Case Push To SF" "is" "True", this condition will see that the checkbox has been checked. Once done, click on Update.

  9. Now for the time rule. Go to the Admin Panel → Cases → Rules → Time Rules.

  10. Click on "Add Rule" to add the time rule.

  11. Name the rule "Push to SF".

  12. Add a condition to the "All" condition that says  Case Labels does not contain push to sf. Add two rule actions. The first rule action is to "Set Case Push To SF" "True", and then "Append Case Labels" "push to sf" . Once done, click on "Update".

  13. Enable the time rule by clicking the check icon.​​​​

The end result is that all cases are flagged with the "Push to SF" custom field being true by the time rule. This in turn triggers the case updated rule to send the cases to Salesforce. The time rule also adds the "push to sf" label to indicate that the case has actually been sent.

Keep in mind that  there are a few factors at play here, so its difficult to determine how long it will take to complete. Some of these factors are:

  • Volume of cases
  • Time rules run every 15 minutes
  • Cases sent via the webhook in the case updated rule are not immediately visible in Salesforce

But once all of your existing cases are pushed over to SF you can turn off or delete the time rule that we had created; remove the values that we added to the Case Updated rule; and  delete the "Push to SF" custom field. You should leave the "push to sf" label intact.

The following articles will guide you in a step-by-step process for the Salesforce to integration:

Step 1: Setting up the Salesforce to Desk Integration

Step 2: How to show Cases within your Salesforce Org

Step 3: Publishing Activity to Salesforce Chatter

Step 4: How to import old cases into your Salesforce integration

Step 5: How to enable a rule using a field from Salesforce

Step 6: Reporting in Salesforce for Cases

Step 7: Displaying Salesforce Fields in Desk through the Salesforce Widget
Upgrading your App in Salesforce

Removing your Salesforce Integration