Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

...

Setup OAuth to Saleforce

  1. Goto https://yourInstance.salesforce.com/lightning/setup/NavigationMenus/home  your App Manager
    Click this link for more details...
  2. Click New Connected App
  3. Enter Name and Email
  4. Click Enable OAuth Settings
  5. Enter Callback URL https://yourInstance.salesforce.com/oAuth2/callback
  6. Add relevant accesslevel, for this tutorial we will use Full Access
  7. Click Save
  1. 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 
    Status
    colourBlue
    titleCreate
     button
  2. Enter a name: Add Saleforce Account and click 
    Status
    colourBlue
    titleCreate
  3. Select Method:
    Status
    colourYellow
    titlePOST
     and URL:https://yourInstance.salesforce.com/services/data/v20.0/sobjects/Account/
    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/Account/
  4. Select Authentication method:  Bearer Tokek,Salesforce (OAuth) 
  5. Add request headers, key: Content-Type with value application/json
  6. On the Body section add the following

    Code Block
    {
    	"name":"{{issue.reporter.username}}"
    }

    Here we use the mustache syntax to grab the user name of the reporter.

  7. Click Triggers tab
  8. Select 
    Status
    colourGreen
    titleIssue 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 
    Status
    colourBlue
    titleSAVE
  11. (Optional) Click Test button (no issue key is needed) to and click Send, Then go View Execution Log.

Result The result will have a response like the one below:

...

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