That approach assumes to know the relation of X and Y in advance, meaning you have a curated, up-to-date list of your tech debt or even better: a map of techdebt-to-feature.
However, working with legacy, you often find techdebt or inadequate architecture/infrastructure mid project...