Create task from description cleanup
In https://gitlab.slack.com/archives/C02403NRD40/p1702034567434799 (internal only) it was raised that the workItemUpdateTask
mutation is not working as expected. A lot has changed in the work items API since this mutation was introduced, but looking at how the feature works now (creating a child task from an item on an issue's description list, see video below), I think there are at least 3 mutation that were introduced to support the original behavior of the future and might not be needed anymore
Screen_Recording_2023-12-11_at_12.11.42
From the video above we can see the feature is much simpler now as it simply removes the text from the description when a new task is created.
Old mutations that might not be used anymore
WorkItemCreateFromTask
Mutation took several params to create a new task, link the new task with the parent and update the parent's description with a link to the new task. From the new behavior I see we simply create a new task and link it to the parent using the hierarchy widget. If create is successful, the frontend uses the internal REST API to update the parent's description and remove the line that is now the title of the new task
WorkItemUpdateTask
Mutation introduced before the widget interface was created on both create and update work item mutations. The input arguments on the mutation were later extended to support the widget interface, but the mutation itself was never updated to handle those new arguments, so at the moment it will return an error if widget arguments are passed to it. Not sure if this is still used in the frontend, but I did find some references to it. Originally, the intention of this mutation was to update the title of a child task while at the same time clearing the etag cache of the parent. But I think this is no longer necessary since we now remove the task title from the parent issue's description. Before, as we replaced the item's text in the description with a link to the new child, we wanted that link to be updated whenever the child's title was updated
WorkItemDeleteTask
Just like the others, in the original behavior, we wanted to be able to delete a child directly from the parent's issue's description. So this mutation would take the child's ID as well as some line number arguments on the parent's description so it could update it and remove the reference to the child there too