diff --git a/polarion_rest_api_client/clients/base_classes.py b/polarion_rest_api_client/clients/base_classes.py index 2f79f51..bb74316 100644 --- a/polarion_rest_api_client/clients/base_classes.py +++ b/polarion_rest_api_client/clients/base_classes.py @@ -250,6 +250,8 @@ class StatusItemClient(UpdatableItemsClient, t.Generic[ST], abc.ABC): them. This status has to be provided on initialization. """ + item_cls: type[ST] + def __init__( self, project_id: str, @@ -266,6 +268,10 @@ def delete(self, items: ST | list[ST]): else: if not isinstance(items, list): items = [items] + delete_items: list[ST] = [] for item in items: item.status = self.delete_status - self.update(items) + delete_items.append( + self.item_cls(id=item.id, status=self.delete_status) + ) + self.update(delete_items) diff --git a/polarion_rest_api_client/clients/work_items.py b/polarion_rest_api_client/clients/work_items.py index b30f503..57b08c6 100644 --- a/polarion_rest_api_client/clients/work_items.py +++ b/polarion_rest_api_client/clients/work_items.py @@ -49,6 +49,7 @@ def __init__( project_id, client ) self.links = work_item_links.WorkItemLinks(project_id, client) + self.item_cls = dm.WorkItem def _update(self, to_update: list[dm.WorkItem] | dm.WorkItem): assert not isinstance(to_update, list), "Expected only one item"