Automatically close duplicated tasks

Hi guys,
I am looking for a way to automatically close duplicated tasks in other projects.

If I understood correctly, it should not be too difficult to create a automatic action which looks up the task ID of the duplicate via the internal link, isn’t it?

I am willing to help developing this if anyone can give me some hints on where I would need to do it.

Thanks, Tobelix