Body
This how-to article will help Administrators (global and application) to create a ticket in a workflow using Web Services. The user must have the Admin rights for performing these steps.
Overview
Web service steps open up extensive possibilities for managing processes, allowing tickets to be modified, created, or notifications sent out to name a few examples on ticketing workflows. This article serves as an example of adding a ticket workflow step that will create another ticket. This could be if a Ticket comes in for Team A, and there is separate work for this request that Team B must complete, this workflow example will allow that separate ticket to be created for Team B.
Learn more about setting up and using web service steps.
There are several steps needed to set up a workflow step that will create a second ticket:
- Define a web service provider and create authentication credentials.
- Get the Ticketing Application ID.
- Locate the ticket status ID for the new ticket.
- Get a ticket source ID for the new ticket.
- Get a ticket priority ID for the new ticket.
- Locate the ticket classification ID for the new ticket.
- Get ticket requestor UID for the new ticket.
- Create the web service method.
- Test the method.
Creating a Web Service Provider and Auth Account
Follow the instructions in the Web Service Step article, to learn how to define a web service provider and create authentication credentials.
Getting the Ticketing Application ID
To find the ticket application ID:
- In TDAdmin, click Applications in the left navigation.
- Click the Name of the desired Ticketing Application.
- In the Application Details window, copy down the ID number located below the application name.
Getting the Ticket Status ID
To get the ticket status ID number for the desired status:
- In TDAdmin, click Applications in the left navigation.
- Click the Name of the desired Ticketing Application.
- Click Statuses,
- then select the ticket ID that you’d like to use for testing.
- Best practice is to write down the ID number you need.
Getting the Ticket Source ID
To get a ticket source ID for the new ticket:
- In TDAdmin, click Applications in the left navigation.
- Click the Name of the desired Ticketing Application.
- Shared settings > Sources. Take note of the number in the ID column.
- Best practice is to write down the ID number you need.
Getting the Ticket Priority ID
To get a ticket priority ID for the new ticket:
- In TDAdmin, click Applications in the left navigation.
- Click the Name of the desired Ticketing Application.
- > Shared Settings > Priorities. Take note of the number in the ID column.
- Best practice is to write down the ID number you need.
Getting the Ticket Classification ID
You can find the ticket classification ID for the new ticket in the TeamDynamix API documentation on the ticket classification article.
For example, the number 46 represents a service request. Please note the Classification is required on ticket creation.
Getting a Ticket Requestor UID
To locate a ticket requestor UID for the new ticket:
- You can use in the Body of the ticket creation, the value of {{RequestorUID}} and it will get the Requestor’s UID from the originating ticket. Keep in mind the value is case sensitive.
Creating the Web Service Method
To create a web service method that will close your ticket:
- 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.
- In the Web Service Provider field, select the web service provider you've already defined
- Click the Method button to the left of the URL field and select POST.
- In the URL field, enter
https://[Your TeamDynamix URL]/TDWebApi/api/[Your Ticket App ID]/tickets
. EX: https://wcsandbox.teamdynamix.com/TDWebApi/api/####/tickets
- Click the Headers tab and define one of the following headers:
- Key – Content-type
- Value – application/json
- Click the Add button to add the header.
- Click the Parameters tab and define the following parameter:
- Name – OrigTicketID
- Type – String
- Data source – From Ticket
- Source property – ID
- Click the Add button to add the parameter.
- If you will be using custom attributes on the new ticket, add additional parameters for each custom attribute you want to copy into the new ticket.
- Name – Enter the name of your custom attribute
- Type – string
- Data source – From Ticket
- Source property – Pick the appropriate custom attribute from the list
- Click the Add button to add the parameter
- Click the Body tab and type or paste the following:
-
{
"TypeID":[Ticket Type ID],
"FormID":[ID of the desired form],
"Title":"Example ticket title",
"Description":"Created from ticket {{OrigTicketID}}",
"AccountID":[Acct/Dept ID],
"SourceID":[Source ID],
"StatusID":[Status ID],
"PriorityID":[Status ID],
"RequestorUID":"[Requestor UID]"
"Attributes":
[
{ "Name": "Custom Attribute Name 1", "ID": [Custom attribute ID], "Value": "[Choice ID, {{parameter}}, or text]" },
{ "Name": "Custom Attribute Name 2", "ID": [Custom attribute ID], "Value": "[Choice ID, {{parameter}}, or text]" },
{ "Name": "Custom Attribute Name 3", "ID": [Custom attribute ID], "Value": "[Choice ID, {{parameter}}, or text]" },
]
}
Replace each of the [bracketed] sections with the appropriate ID. Do not include the brackets. For custom attribute values replace the [bracketed] section with the appropriate parameter name in {{braces}} from step 12, or use the choice ID of the custom attribute choice (for choice-based fields like dropdowns or checkboxes), or enter text (for text-based fields like textareas or textboxes).
Testing the Method
You will need a ticket ID number to use for testing.
To test the new method:
- Click the Authentication tab and select your TeamDynamix web service account.
- Click the Save button.
- In the web service, select Test
- In the OrigTicketId column, along with any other value IDs that are missing
- 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.