Trying to figure out what to use as OQL statement when creating an action on Work order, triggered when it is closed.
I want to send an email to the corresponding agent assigned to the change involved.
I've been struggling with this very thing. After much trial and error I came up with this:
SELECT Person AS p
JOIN Ticket AS t ON t.agent_id = p.id
JOIN WorkOrder AS w ON w.ticket_id = t.id
it seems to work for me.