Skip to content

Commit

Permalink
fix: some other attributes when creating work items are optional
Browse files Browse the repository at this point in the history
  • Loading branch information
micha91 committed Oct 25, 2024
1 parent 4c2ca23 commit 643531d
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions polarion_rest_api_client/clients/work_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,20 +302,21 @@ def _build_work_item_post_request(
self, work_item: dm.WorkItem
) -> api_models.WorkitemsListPostRequestDataItem:
assert work_item.type is not None
assert work_item.title is not None
assert work_item.description is not None
assert work_item.status is not None

attrs = api_models.WorkitemsListPostRequestDataItemAttributes(
type=work_item.type,
description=api_models.WorkitemsListPostRequestDataItemAttributesDescription( # pylint: disable=line-too-long
type=api_models.WorkitemsListPostRequestDataItemAttributesDescriptionType( # pylint: disable=line-too-long
work_item.description.type
),
value=work_item.description.value or "",
description=(
api_models.WorkitemsListPostRequestDataItemAttributesDescription( # pylint: disable=line-too-long
type=api_models.WorkitemsListPostRequestDataItemAttributesDescriptionType( # pylint: disable=line-too-long
work_item.description.type
),
value=work_item.description.value or "",
)
if work_item.description
else oa_types.UNSET
),
status=work_item.status,
title=work_item.title,
status=work_item.status or oa_types.UNSET,
title=work_item.title or oa_types.UNSET,
)

attrs.additional_properties.update(work_item.additional_attributes)
Expand Down

0 comments on commit 643531d

Please sign in to comment.