top of page

Automatic Ticket Reassignment with Ticketing as a Service Webhooks

Hi All,


Have you ever wished Ticketing as a Service could automatically take action when a ticket changes status, without anyone having to do it manually? That is exactly what webhooks make possible.


A webhook is a way for Ticketing as a Service to notify another app the moment something happens. When a ticket is created, updated, or changes status, Ticketing sends an automatic notification to a URL you set up. The app on the other end receives that notification instantly and can act on it right away, with no delays and no manual steps.


When you connect that to Power Automate and the Ticketing API, you can build automations that respond to ticket events in real time. This tutorial walks through one example: when a ticket moves to "Pending Approval", a Power Automate flow automatically reassigns it to the right person before anyone has to touch it.


Tutorial: Automatic Ticket Reassignment on Status Change

In this tutorial, the scenario is: when a ticket moves to "Pending Approval", a Power Automate flow queries your organization's on-call schedule, rotation list, or org chart, and assigns the correct approver automatically.


"Pending Approval" is a custom workflow status. Ticketing as a Service lets you define your own ticket statuses and transitions beyond the defaults, so you can model your team's exact approval process. You can follow along with any status in your instance. See how to create custom workflows in Ticketing as a Service to learn more.


Create the Power Automate Flow

  1. Go to Power Automate and create a new Instant cloud flow and select "When an HTTP request is received" as the trigger.



  1. Then set Who can trigger the flow? to Anyone. This ensures the generated URL includes the authentication token that Ticketing needs to deliver payloads successfully.



  1. Add a Condition action. Set the left value to the expression `triggerBody()?'data']?'status']?'to']`, the operator to is equal to, and the right value to Pending Approval.



It should be shown like this:



  1. In the True branch, add an HTTP action. Set the method to PUT, the URL to your Ticketing API base URL and the expression `triggerBody()?'data']?'ticket']?'id']` to pull the ticket ID from the payload.


https://teamswork.azure-api.net/ticketing/v1/tickets/@{triggerBody()?['data']?['ticket']?['id']}?key={your_key}&timezone=7

Add a `Content-Type: application/json` header, then use the following as the request body.


Here is an example of the request body. Replace the values with the actual user details from your organization.


{
  "ticket": {
    "assignee": {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Megan Bowen",
      "email": "megan@contoso.com"
    }
  },
  "user": {
    "id": "f9e8d7c6-b5a4-3210-fedc-ba9876543210",
    "name": "Allan Deyoung",
    "email": "allan@contoso.com"
  }
}

It should look like this:



`ticket.assignee` is the person being assigned. `user` is whoever is performing the reassignment, recorded in the activity log. To find the user IDs and details for your organization, check the Ticketing API documentation.

  1. Save the flow. Power Automate generates an HTTP POST URL in the trigger step. Copy this URL.




Add the Webhook in Ticketing

  1. In Ticketing settings, go to Webhooks, click Add Webhook, enter a name, and paste the Power Automate URL into the URL field.


  1. Enter a Secret Key (a string you define yourself, minimum 16 characters), then set Event entity to Ticket and Event action to Status Changed.



  1. Enable the webhook, then click Test Webhook. You should see a 202 response, which confirms Ticketing can reach your Power Automate flow successfully.



How It Works in Action

Once saved, the flow runs on every `ticket.status_changed` event, and only transitions to "Pending Approval" trigger the reassignment logic.


A new ticket created and status still open.



When the status changed to "Pending Approval", the assignee changed to Megan.



The webhook payload includes the event type, a unique event ID, a timestamp, the full ticket object under `data.ticket`, the actor under `data.user`, and the status transition under `data.status` with `from` and `to` fields. For the complete payload reference, see Ticketing Webhook Documentation.


This same pattern works for other automation scenarios too. You could use webhooks to connect Ticketing as a Service to Microsoft Copilot, route tickets for incident management workflows, or build custom integrations using the Ticketing API with custom fields.


Hope you find this post helpful for building your first webhook-powered automation in Ticketing as a Service.


Have a nice day!


Marc




TeamsWork is a Microsoft Partner Network member, and their expertise lies in developing Productivity Apps that harness the power of the Microsoft Teams platform and its dynamic ecosystem. Their SaaS products, including CRM as a Service, Ticketing as a Service and Checklist as a Service, are highly acclaimed by users. Users love the user-friendly interface, seamless integration with Microsoft Teams, and affordable pricing plans. They take pride in developing innovative software solutions that enhance company productivity while being affordable for any budget.

Comments


bottom of page