Create new Case in Salesforce

This tutorial shows how you can add a Salesforce account and store the account ID on the ticket for update purpose.

Assumption

  1. That you have a connected App if not see Setup Salesforce Connected App and API user for the integration
  2. That you have an OAuth authentication setup Setup OAuth to Salesforce

Steps

  1. Create a new Action by clicking CREATE button
  2. Enter a name: Add Saleforce CASE and click CREATE
  3. Select Method: POST and URL:https://yourInstance.salesforce.com/services/data/v20.0/sobjects/Case/
    From the Saleforce REST API we can read that to add an account we need to call POST https://yourInstance.salesforce.com/services/data/v20.0/sobjects/Case/
  4. Select Authentication method: Salesforce (OAuth) 
  5. Add request headers, key: Content-Type with value application/json
  6. On the Body section add the following

    {
    	"subject":"{{issue.summary}}"
    }

    Here we use the mustache syntax to grab the issue summary

  7. Click Triggers tab
  8. Select ISSUE RESOLVED event, in this example we will use the Issue Resolved event to indicate that the user shall be added. 
  9. On JQL Condition. When to execute the event(s) write Project = TESTB and to limit the trigger to the TESTB project
  10. Click SAVE
  11. (Optional) Click Test button (no issue key is needed) to and click Send, Then go Log Tab.

The result will have a response like the one below:

{
	"id": "5002o00002QMXK5AAP",
	"success": true,
	"errors": []
}

Optional steps to inform the reporter about being added are to create a chained action that comments the issue.