Adding epic as descendant of another can result in 404 instead of 409 when depth > 5
Adding an Epic with depth < 4 as a sub-epic of another with levels of ancestry < 4 results in a 404 when total depth > 5.
Steps to reproduce
Parent Epic 1and add 4 sub epics.
Parent Epic 2and add 3 sub epics
- Go to the lowest epic in the hierarchy of Parent Epic 1.
- Add Parent Epic 2.
What is the current bug behavior?
Currently a 404 is returned with the error message
No Epic found for given params.
What is the expected correct behavior?
A 409 should be returned with the message
Epic hierarchy level too deep, as when Epics are added sequentially (i.e. epic already has depth 5 and you try to add another sub-epic).
This is important because it will affect the error message shown to the user when #32557 is complete.
(If you can, link to the line of code that might be responsible for the problem)