List tasks that reference the current note?

What I’m trying to do

I have tasks that are related to projects.
A project is a note.

I now want to list all open tasks that are related to this project.

I want to do it either through links to this project, e.g.:

- [ ] First Todo [[Project]]

or through tags, where I define the tag for this project in the frontmatter of the project note:

- [ ] First Todo #p/project

project.md:

---
tags: p/project
---

Somehow I cannot find out how to filter by links in tasks scripts.
And I can’t find out how to use the frontmatter variable tags in the tasks scripts as well.

Can anyone tell me how to do this?