Using GitHub webhooks to add message to ticket
Two of our primary tools for maintaining control when developing customizations for our customers are GitHub and SuperOffice Service, and here I'll briefly describe how we've used CRMScript to create a light integration between the 2 systems.
[!include[ALT](../../../includes/new-to-CRMScript.md)]The jist of it is that whenever we commit code to GitHub, we can optionally include a Ticket ID in the commit message, and this will create a message in our SuperOffice.
So a commit like this:
Generates this on the correct ticket:
The first step is to create a web service in SuperOffice with a script similar to this:
[!include[ALT](includes/CRMScript.md)]Tip
Remember to wrap the script in the appropriate EJSCRIPT start and end tags
The 2 includes can be found in the SuperOffice CRMScript repo.
The next step is to tell GitHub to post JSON to SuperOffice whenever a commit happens.
We've set the setting on the GitHub organization level by going to Settings and the WebHooks settings. Create a webhook there that points to the script.
The URL looks like this:
https://crm.example.com/scripts/customer.fcgi?action=safeParse&includeId=github-webhooks-all&key=secret
And from then on all commits that contain the magical ID reference will end up as messages in SuperOffice.