/
Configure Automatic Pull from Salesforce

Configure Automatic Pull from Salesforce

This guide helps you to configure Automatic Pull from Salesforce by enabling the Automatic Pull feature, as well as configuring the required Salesforce triggers. If you haven't done so, configure the available objects and fields before proceeding with the following steps. The Salesforce Package must be installed and configured as well.

 

Automatic Pull only works if:

  • Connection is configured to Allow Automatic Pull

  • Association is configured to Allow Automatic Pull

  • Salesforce Triggers for the respective objects are installed

  • Connection allows modification

  • The Salesforce object for which you configure the Automatic Pull trigger is configured to be available

A word on naming: Automatic Pull in Jira is called Automatic Push in Salesforce. The naming is chosen based on the point of view of the user of the respective system.

Enabling Connection to allow Automatic Pull

  1. Go to Settings > Apps, and then in the sidebar, under Salesforce, choose Connections.

  2. At the Salesforce Connections screen, go to the Connection you want to configure > Options Menu > Configure.



  3. At the Connection Configuration screen, locate the Connection Settings and enable the switch for Allow Automatic Pull. At this point make also sure the switch for Allow Modification is enabled:

Create Automatic Pull Enabled Association

Automatic Pull from Salesforce has to be enabled/disabled per Association. You can do this either when creating an association or later by Configuring an association. Additionally, the preset configuration for the Automatic Pull switch can be configured on the Connection Configuration page.

Create and Deploy Apex triggers

The Connector relies on Apex triggers to be informed of changes on Salesforce objects. These triggers have to be created and deployed manually in Salesforce. For Salesforce Enterprise and Unlimited edition, the standard deployment of Apex triggers are required (see Salesforce documentation).

The following code samples shows how to write triggers for Cases. To create triggers for other objects, replace the object name in the code accordingly.

Push to Jira after Object updated 
 

Cloud

CaseUpdatedTrigger
trigger CaseUpdatedTrigger on Case (after update) { JCFS.API.pushUpdatesToJira(); }

Server

CaseUpdatedTrigger
trigger CaseUpdatedTrigger on Case (after update) { JSFS.API.pushUpdatesToJira(); }



Apex test class for the triggers

Once triggers are created, they need a certain level of test coverage to be allowed to deploy to the Production environment. The package contains a test helper which tests the whole scenario. You simply need to add a unit test for each trigger and call the test helper method as follows:

Cloud

CaseUpdatedTriggerTest