Client Work

Calculating if a Ticket’s SLA was met using Custom Coded Workflows

A computer with a keyboard and a screen
Back to List Next Article

Client’s Challenge

The client needs to create a Custom Coded Workflow which looks at the following criteria for a Ticket in HubSpot:
1. The "Severity level" (priority) of the ticket. Then it needs to set an SLA.
2. Calculate the time the ticket has spent in a stage (to the minute). If the SLA is not met, then it needs to update another property with, "Missed".
This is NOT as easy as it sounds… let’s take a look!!




First, we defined the workflow’s process…

Our HubSpot Specialists created two workflows to calculate the time it takes for a ticket to change stage and verify if it complies with the SLA time.

This is what it looks like…

Workflow 1: Get Ticket Stage and Start Time 

The first workflow marks the time the Ticket entered the current stage and saves them in other properties.

SLA Timer to get ticket stage and start time

Workflow 2: Compare Time Spent with SLA Time

The second workflow compares the time the Ticket moved to another stage, calculates how long it spent in the previous stage, and then compares it to the SLA time.

Compare time spent with SLA time


Client Quote


“We demoed the solution and it went well!”


Talk to a HubSpot Expert

Questions? Let's talk to you to learn more about you and your business and how our onboarding process works to ensure we are a great fit.