You could use a task-based workflow to close the task:
Create workflow
Skip trigger and choose eligible records
Task → Save and continue
Enroll task when Created at is more than 1 day ago AND Owner assigned date of associated ticket is less than 1 day ago
Use ‘Edit record’ to set the ‘Task status’ and complete task
The filter for the create date in step 4 is to make sure that newly created tasks aren’t closed directly. It does however limit the capabilities of this workflow slightly as re-assignments within the first day will not close the existing task.
If you want to achieve this, you would have to work with a custom code action.
I know the limitation here feels a bit odd. HubSpot workflows tied to tickets can create new tasks, but they can’t directly “find and update” an existing open task tied to that same ticket.
The closest native path is to build a task-centered workflow, as Karsten mentioned, and use enrollment criteria plus an “Edit record” action to flip the Task status to Completed. HubSpot’s doc on editing tasks inside workflows might help as reference:
If you prefer not to rely on task-based enrollment, the only alternative inside HubSpot is custom code actions where you query the ticket’s associated tasks and close them programmatically
If your tickets and tasks also exist in another system, a real-time two-way sync can simplify this closing the old task in one system automatically propagates to HubSpot, so you don’t need to build special workflow logic for every reassignment. When orders, tickets, or tasks must stay aligned, Stacksync maps them one-to-one so the right records update instantly across both sides.