##Slack to Codebase Webhook
This is a php application you can put on your server to serve as the endpoint for a Slack outgoing webhook. It's purpose is to enable you to use trigger words in your chat to communicate with your CodebaseHQ account and trigger the folowing events:
cbtkthelp
cbgettkt [project:my-project]
cbgettkt [tkt: 1234]
cbposttkt [project:my-project] [assigned:nerrad] [type:bug] [priority:low] [status:new] [summary: This is an optional summary, if not included, a condensed version of chat message will be used] Your chat message becomes the initial ticket description.
cbupdatetkt [tkt: 1234] [type:bug] [priority:high] [status:completed] [assigned:nerrad] This chat message gets appended as a note to the ticket.
More credits will go in this space. But look at the composer.json and you'll see who laid some groundwork to make this possible.
More notes will eventually go here. However here's some basic components
- Clone this to the server you will use as the webhook endpoint and make sure you've got the ip address listening for http requests.
- Use
composer install
to load in all the dependencies. - Copy
app-config-sample.php
toapp-config.php
and add in all the necessary credentials there (follow inline docs). - Setup the outgoing webhook in your slack account (where you'll get the token to add to
app-config.php
. You'll also need to add the trigger words in that webhook.
It's fairly easy to add them, while I'm likely going to abstract things a bit further as time goes on, for now all the trigger word logic/handling is done in /include/React.php
You just add a method in there that matches your trigger word and then the resulting logic for what happens with that trigger word. Pull requests welcome!!