Skip to content

Commit

Permalink
fix: add workitem ID if available in create_work_items
Browse files Browse the repository at this point in the history
  • Loading branch information
micha91 committed Dec 18, 2023
1 parent 777d8b3 commit b05d6f8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion capella2polarion/elements/api_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def patch_work_item(
old.linked_work_items = api.get_all_work_item_links(old.id)
new.type = None
new.status = "open"
new.id = old.id
assert new.id is not None
try:
api.update_work_item(new)
handle_links(
Expand Down
2 changes: 2 additions & 0 deletions capella2polarion/elements/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def create_work_items(
assert work_item is not None
assert work_item.title is not None
assert work_item.type is not None
if old := ctx["POLARION_WI_MAP"].get(work_item.uuid_capella):
work_item.id = old.id
if work_item.type in valid_types:
work_items.append(work_item)
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
'<html><p><img style="max-width: 100%" src="data:image/svg+xml;base64,'
)
TEST_SER_DIAGRAM: dict[str, t.Any] = {
"id": None,
"id": "Diag-1",
"title": "[CC] Capability",
"description_type": "text/html",
"type": "diagram",
Expand Down

0 comments on commit b05d6f8

Please sign in to comment.