<p class=”alert alert-info”>This how-to article will help administrators to use a Workflow Web Service in TDAdmin to create a post to a Twitter account. The user must have the Admin or App Admin permissions to create this.</p>
Overview
This article serves as an example of adding a ticket workflow step that will post information to Twitter. This could be used to do something like sending out details on a Problem or Major Incident that arises within an IT Department and wants to inform their audience of details pulled from the ticket.
Learn more about setting up and using web service steps.
This web service requires using another service called Zapier, a tool that helps move info between web applications.
There are several steps needed to set up a workflow step that will post to Twitter:
- Create a Zapier account.
- Set up a Zap.
- Create the web service method.
- Test the method.
Creating a Zapier Account
Sign up for a free Zapier account which provides you with 100 simple two-step Zaps (trigger + action) per month.
Setting Up a Zap in Zapier
Zaps are what connect a trigger and assign a corresponding action.
Choose to create a new Zap and fill out the information to use a Catch Hook with Webhooks by Zapier as the trigger and Create a Tweet in Twitter as the association action step (will ask to link the account you want post to Twitter as).
This will have a test process where you have to actually POST JSON to the Zapier, validate it and choose the field you from your JSON to put into a Tweet template after receiving a valid POST.
Once your Zap is up, tested and live, make sure to record your Zap URL as that is what you’ll need to put in TDX. It will look something like this:
https://hooks.zapier.com/hooks/catch/XXXXXXX/YYYYYY/
Creating the TeamDynamix Web Service Method
This example will create a very simple post to Twitter and includes the ID of the current ticket.
Note that Zapier is very strict about JSON syntax and both property names and values must be quoted.
To create a web service method that will post to Twitter:
- In TDAdmin, click Applications in the left navigation.
- Click the Name of the Ticketing application you want to add this workflow step to.
- Click Workflow Web Services in the left navigation, then click Web Service Methods.
- Click the +New button.
- On the New Web Service page, enter a Name for the method. This name will show up in the workflow builder
- Provider: Create a provider which is the URL of the Zapier Hook URL (obtained above).
Authentication: No authentication is required to post to Zapier URLs. Leave the dropdown blank.
Method (verb): POST
URL: This should be prefilled from the provider URL (which is the web hook URL) and should not need to be changed.
Headers:
- Key: content-type
Value: application/json
- Parameters:
- TicketID - Integer - From Ticket – ID
- Body:
- {
"text":"Ticket ID {TicketID} started the approval workflow!"
}
Testing the Method
You will need a ticket ID number to use for testing. Be sure to only use the fields and properties you sent to Zapier in your test.
To test the new method, in the web service:
- Click the Test Request button.
- In the OrigTicketId column, enter any number
- Click the Send button
- Verify the output
This web service method can now be included in a ticket workflow. Learn more about adding a web service step to a workflow.