Appending the User story subject to a task subject

If a task is being created I would like to add the user story subject as a suffix to the task subject.

If would be somewhere in here Adding the id as a prefix of the title of a created elements I imagine. Where the task would reference the user story subject.

I’m asking how to find the user story when a task subject is being updated.