Closing off tasks automatically based on project status

Closing off tasks automatically based on project status

Is there a way to close off all open tasks when a project is set as Cancelled?