Skip to content

Improve error message when setting parent of a work item

What does this MR do and why?

Related to #464283 (closed)

When setting the parent of a work item, any error is currently returned formatted for the parent context, not the child. For example, when viewing a work item with a reference #10 and trying to add a work item #20 as a parent that returns an error, we currently see:

#10 cannot be added: is not allowed to add this type of parent

To fix this, this MR changes the errors returned when changing a parent to reference the parent instead. The example above will display:

#20 cannot be added: is not allowed to add this type of parent

Other examples (in this case the work item reference is #54):

Before After
When trying to add #56 as a parent, that is a confidential work item
confidential_error_before confidential_error_after
When trying to add #55 as a parent, that is a child work item
parent_is_child_error_before parent_is_already_a_child_after
When trying to add #46 as a parent, that is a task
invalid_type_of_parent_before invalida_parent_type_after

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eugenia Grieff

Merge request reports