Using Web Services to Change the Status of a Ticket

Summary

Step-by-step instructions on how to build a workflow to change the current status of a ticket.

Body

This how-to article will help Administrators to configure a Workflow Web Service in the TDAdmin interface. The user must have the Administrator access in TDAdmin.

Overview

Web service steps open up extensive possibilities for ticket creation, modification, and editing as part of a ticketing workflow. This article serves as an example of adding a ticket workflow step that will change the status of a ticket. This could be used to do something like a status change is needed after a certain step of a workflow is completed.

Learn more about setting up and using web service steps.

There are four main web service items needed to set up a workflow step that will change the status of a ticket:

  1. Define a web service provider and create authentication credentials.
  2. Get the ticket application ID.
  3. Get the ticket status ID.
  4. Create the web service method.
  5. 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:

  1. In TDAdmin, click Applications in the left navigation.
  2. Click the Name of the Ticketing application.  
  3. 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:

  1. In TDAdmin, click Applications in the left navigation.
  2. Click the Name of the Ticketing application.
  3. Click Statuses,
  4. then select the Status ID that you’d like to use.

Creating the Web Service Method

To build a web service method that will close your ticket:

  1. In TDAdmin, click Applications in the left navigation.
  2. Click the Name of the Ticketing application you want to add this workflow step to.
  3. Click Workflow Web Services in the left navigation, then click Web Service Methods.
  4. Click the +New button.
  5. On the New Web Service page, enter a Name for the method. This name will show up in the workflow builder.
  6. In the Web Service Provider field, enter the web service provider you've already defined.
  7. Method (to the left of the URL box in green. The default is GET) – Select PATCH
  8. URL https://[Your TeamDynamix URL]/TDWebApi/api/[Ticket App ID]/tickets/{{id}}
    Note that you need to replace [Your TeamDynamix URL] and [Ticket App ID] with the URL of your TeamDynamix environment and the ticket application ID that you took note of. Do not edit {{id}}.
    The final string will look something like https://example.teamdynamix.com/TDWebApi/api/123/tickets/{{id}} or https://services.example.com/TDWebApi/api/123/tickets/{{id}}
  9. Headers – Define one of the following headers:
    1. Key – Content-type
    2. Value – application/json 
    3. Click the Add button to add the parameter
  10. Parameters – Define one of the following parameters. Click the Parameters tab and enter the following details:
    1. Name – id
    2. Type – string
    3. Data source – From Ticket
    4. Source property – ID
    5. Click the Add button to add the parameter
  11. Click the Body tab and type or paste the following: [ {"op": "replace", "path": "/StatusID", "value": "#####"}, ]
    Replace ##### in quotations with the status ID for the status you’d like.
  12. Click on the Authentication tab and select your TeamDynamix web service account.
  13. Click the Save button.

Testing the Method

You will need a ticket ID number to use for testing.

To test the new method, inside the web service:

  1. Click the Test Request button.
  2. In the ID column, enter the ticket number you’d like to use for testing.
  3. Click the Send button.
  4. 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.

 

Details

Details

Article ID: 18758
Created
Thu 11/17/16 8:11 PM
Modified
Thu 11/7/24 9:33 PM