Filter Tasks With Outgoing Links to Notes in A Specific Folder

What I’m trying to do

In my daily notes, I have a simple to do list that typically contains no links. Below that, I keep track of the tickets I am working on and what customer they are for.
Each ticket number links to a note in my “Tickets” folder about that ticket.
Each customer links to a note in my “Customers” folder about the customer.
image

I am attempting to have any tasks that are not completed carry over to the next day, but I would like them to still stay separated in my To-Do and Tickets sections.

Things I have tried

I got pretty close with this. The issue is it returns all uncompleted tasks with any outgoing links, not just outgoing links to “Tickets”.

TASK
where !completed
AND (map(outlinks, (l) => endswith(l.file.folder, "Tickets")))

I am wondering if the issue is that these tasks have outgoing links to notes in the folder “Tickets” and “Customers”?

Another approach would be to do something like the following:

```dataview
TASK
WHERE !completed
  AND meta(section).subpath = "Tickets"
```

This would utilise the section link of the task which points to the section, to check that it’s actually within the Tickets header.

Thank you, @holroy! I like this way a lot more!
For some reason, I did not think pointing to the section worked with tasks.