|Version 18 (modified by chriswolf, 4 years ago) (diff)|
Trac Ticket to Salesforce ticket synchronization
Maintain synchronization of Trac tickets in Salesforce. Trac tickets are reflected by the Salesforce custom objects, Ticket and Comment. Ticket objects are linked to Cases via M2M relationship provided by the CaseTicketLink custom object. Even though this is a M2M relation, Trac uses a custom text field for the Case number, so it's essentially many-to-one.
Comment objects are related to Ticket objects via the link custom object, TicketCommentLink. The related lists layouts are modified to display the related object fields rather then the object id.
See the Module Dependencies required.
You will need to deploy the following Salesforce project artifacts using either the Eclipse SForce plugin or the ant-based migration tool.
src/layouts/Case-Case Layout.layout src/layouts/Comment__c-Comment Layout.layout src/layouts/Ticket__c-Ticket Layout.layout src/layouts/TicketCommentLink__c-TicketCommentLink Leyout.layout src/objects/Ticket__c.object src/objects/Comment__c.object src/objects/CaseTicketLink__c.object src/objects/TicketCommentLink__c.object
The "migration tool" is just a set of Salesforce-specific Ant tasks which use the metadata API to upload/download artifacts, such as custom objects, etc.
I provide an Ant script to perform the deployment. You need to acquire the ant-salesforce.jar by following these steps:
- Log into a Salesforce.com org on your deployment machine.
- Click Your Name ➤ Setup ➤ Develop ➤ Tools, and then click Force.com Migration Tool.
- Save the .zip file locally and extract the contents to the directory of your choice.
- Copy ant-salesforce.jar into your Ant installation's lib directory. The lib directory is located in the root folder of your Ant installation. You could also just copy this jar to the same directory as build.xml
- Install the custom objects and custom page layouts into your Salesforce org.
- Copy trunk/src/trac/plugin/ticket2sforce.py to trac/projects/<yourproj>/plugins
- Generate the partner WSDL and copy it into your trac/projects/<yourproj>/conf directory
- Edit trac.ini to enable the ticket2sforce component as well as setting the web service API credentials.
To install the custom objects and page layouts:
$ cd trunk/src $ ant deploy
If you have any issues, create a new ticket.
Download the zipped source from here.
- sforce, salesforce-python-toolkit, http://code.google.com/p/salesforce-python-toolkit/
- suds, versions 0.3.6 to 0.3.9 ONLY (i.e. 0.4.0 WON'T WORK) Python SOAP API, https://fedorahosted.org/suds
- XML-RPC Plugin
Example settings in trac.ini are:
[components] tracrpc.* = enabled ticket2sforce.* = enabled ticketvalidator.* = enabled [ticket2sforce] username = yourSFusername password = yourSFpasswd sectoken = yourSFsecurityToken wsdl = partner.wsdl [ticket-custom] case_number = text case_number.label = Case Number [ticketvalidator] new.required = case_number