Using web services to create a second ticket

.

Scenario You want a ticket workflow step that will create a second ticket.
You Need
  • TeamDynamix administrator account
  • TeamDynamix web service provider and auth account
  • Ticket application ID. You can find this from TDAdmin > Applications: write down the number in the "ID" column
  • Ticket type ID for the new ticket. You can find this from TDAdmin > Applications > [Ticketing application] > Types: write down the number in the "ID" column.
  • Status ID for the new ticket. You can find this from TDAdmin > Applications > [Ticketing application] > Statuses: write down the number in the "ID" column.
  • Ticket priority ID for the new ticket. You can find this from TDAdmin > Applications > [Ticketing application] > Shared settings > Priorities: write down the number in the "ID" column.
  • Ticket form ID for the new ticket. You can find this from TDAdmin > Applications > [Ticketing application] > Forms: write down the number in the "ID" column.
  • Ticket requestor UID for the new ticket. This is hard to find--you have to get it from the API through a people search. Or, you can omit this, and the requestor will start out being blank.
This article will help you create
  • "Create another ticket" web service method


Here are the steps to build a web service method that will create a ticket:

  1. Go to TDAdmin > Applications > [Your ticketing application]
  2. Go to "Web Service Methods"
  3. Click "New+"
  4. Create the web service method:
    1. Name: Whatever you want to name the method. This name will show up in the workflow builder.
    2. Web service provider: The TeamDynamix web service provider you've already defined.
    3. Method (to the left of the URL box): Choose "POST"
    4. URL: "https://[Your TeamDynamix URL]/TDWebApi/api/[FIXME Ticket App ID]tickets?EnableNotifyReviewer={EnableNotifyReviewer}&NotifyRequestor={NotifyRequestor}&NotifyResponsible={NotifyResponsible}&AllowRequestorCreation={AllowRequestorCreation}".
    5. Headers: Define one header:
      1. Key: Content-type
      2. Value: application/json 
      3. Click "Add" to add the parameter
    6. Parameters: Define one parameter:
      1. Name: OrigTicketID
      2. Type: string
      3. Data source: "From Ticket"
      4. Source property: "ID"
      5. Click "Add" to add the parameter
    7. Body: Put the following:
      1. {
        "TypeID":[FIXME Ticket Type ID],
        "FormID":[FIXME ID of the desired form],
        "Title":"Example ticket title",
        "Description":"Created from ticket {{OrigTicketID}}",
        "AccountID":[FIXME Acct/Dept ID],
        "SourceID":[FIXME Source ID],
        "StatusID":[FIXME Status ID],
        "PriorityID":[FIXME Status ID],
        "RequestorUID":"[FIXME Requestor UID]"
        }
        

        Replace each of the "[FIXME]" sections with the appropriate ID.

    8. Authentication: Select your TeamDynamix web service account
    9. Click "Save"
  5. Click "Test Request" to test this request.
    1. For the "OrigTicketId" column, put any number
    2. Click "send"
    3. Verify the output

You now have a web service method that creates a ticket that you can include in a workflow!

0% helpful - 1 review

Details

Article ID: 18608
Created
Wed 11/16/16 4:11 PM
Modified
Wed 4/21/21 5:20 PM