This article will help TeamDynamix Administrators to setup Workflow Web Services in your Ticketing application. The individual must have access to create a Service Account with Administrative privileges.
Note: With the exception of creating the Service Account, Application Administrators can perform all of the tasks outlined below.
Summary
Workflow web services allow us to use the TeamDynamix Web API to do a variety of different things against tickets in TeamDynamix ticketing applications. They can also be applied in ticketing workflows directly, so if you're using a ticket workflow, you can incorporate workflow web services to automate processes such as creating a new ticket in a different ticket application.
To configure a service account:
- In TDAdmin, navigate to > Users & Roles > Users.
- Click Create > Create Service Account.
- Enter a Username. This must be unique among all the usernames in the system
- Click Next.
- Fill in the required fields:
- First Name and Last Name - Service accounts require a separate first and last name (like a user) so that they can display in lists of users and accounts.
- Security Role - The selected security role will be applied to actions taken by the service account.
- Password
- Click Finish to create the service account.
- Use the Applications tab to add applications the account can access.
- Use the Accts/Depts tab to add Accounts/Departments the account is associated with.
To create a Web Service Auth Account:
- In TDAdmin , go to Applications > [Ticketing application] > Workflow Web Services.
- Select Web Service Auth Account and +New .
- Fill out the Name, Account type will be TeamDynamix Web API
- Leave the radio button marked to Enabled
- Enter in the Service Account username and password.
- Save
To create a Web Service Provider:
- Navigate to your Ticketing application in TDAdmin via Applications > [Ticketing App] > Workflow Web Services
- Select Web Service Providers
- Web service providers need a name and a base URL. Optionally, you can provide a description. Please make sure the "active" checkbox is checked before you use them.
Please visit the following articles for more detailed examples of using Web Service Methods:
Note: Working with workflow web service steps is considered an advanced feature within TeamDynamix. If you are not comfortable with the technical requirements and knowledge required to perform the steps outlined in this knowledge base article, do not proceed.
Locating your API Catalog
The location of your API catalog will vary depending on if you have a vanity URL, or a standard-issue TeamDynamix URL.
Standard SaaS TeamDynamix URL:
- Production: https://ORGNAME.teamdynamix.com/TDWebAPI
- Sandbox: https://ORGNAME.teamdynamix.com/SBTDWebAPI
Vanity URL:
- Production: https://yourVanityURL/TDWebAPI
- Sandbox: https://yourVanityURL/SBTDWebAPI
Working with Parameters
In order to work with variables within your TeamDynamix workflow web service step, you need to declare them as parameters. Your TeamDynamix API catalog will indicate what aspects of the URL can be treated as variables by putting within a set of single { } curly braces. Within the API documentation, TeamDynamix only uses single curly braces in order to remain tool-agnostic, however, within TeamDynamix, a variable is declared by using a set of double {{ }} curly braces. Any parameters you declare in the parameters tab can then by referenced by including the parameter within a set of {{ }} anywhere within the workflow web service step.
E.g., you want to work with the endpoint from your API Catalog to patch a ticket within a workflow, https://YourDomain.teamdynamix.com/TDWebApi/api/{appid}/tickets/{id}
- You can explicitly declare the ticketing appid within the API call (e.g., 100)
- Change the URL from {id} to {{id}}
- {id} is the documentation indicating that this can be a variable
- {{id}} is how TeamDynamix recognizes that there is a variable and will check your declared parameters list to find the value of said variable
- In the Parameters tab, set the following:
- Name as id (case-sensitive!)
- Data type as Integer (String will also work)
- Source is From Ticket
- Source Property is ID
The newly constructed URL is https://YourDomain.teamdynamix.com/TDWebApi/api/100/tickets/{{id}} which will assign the ID of the ticket to the variable id, and which will then perform the API call within Ticketing App, ID 100.
Note: Parameters are always case-sensitive. Please note the casing of a word or value when creating Workflow Web Services.
Constructing the API Body (Working with JSON)
When creating a Workflow Web Service Body for PATCH or POST, you may come across using these following pieces in your JSON:
- Angle Brackets: < >
- Parentheses: ( )
- Brackets: [ ]
- Braces: { }
For more information on working with JSON, reference the official JSON site.
Testing your Workflow Web Service Steps
There are two primary ways to test your newly constructed workflow web service step:
- Using the Test Request button within the workflow web service, or
- Assigning the workflow web service to a workflow step and sending a ticket through the workflow to trigger the step.
Note: Using the Test Request feature within workflow web services initiates a live API call within the system as a way of testing. As such, TeamDynamix recommends building and testing API calls in your sandbox environment first.