Skip to content

Commit 5c58ff3

Browse files
committed
feat: add default query string for get_all_work_items
1 parent 95e4c68 commit 5c58ff3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ client = polarion_api.OpenAPIPolarionProjectClient(
2727
polarion_access_token="PAT123",
2828
)
2929
project_exists = client.project_exists() # Should be True
30-
work_items = client.get_all_work_items("")
30+
work_items = client.get_all_work_items()
3131
```
3232
During the initialization of the client you can define additional settings like the page size when getting items or the maximum content size when bulk creating new items.
3333
In addition, you can define your own Work Item class with custom fields, which become available as attributes on object level instead of being part of the `additional_attributes` dictionary only.
@@ -47,7 +47,7 @@ class CustomWorkItem(polarion_api.WorkItem):
4747
custom_work_item=CustomWorkItem,
4848
)
4949

50-
work_items = client.get_all_work_items("") # the returned Work Items will be instances of CustomWorkItem
50+
work_items = client.get_all_work_items() # the returned Work Items will be instances of CustomWorkItem
5151
uuid = work_items[0].capella_uuid # the value of the custom field capella_uuid can be accessed this way
5252
```
5353
## Usage of the autogenerated OpenAPI Client

polarion_rest_api_client/base_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def get_work_item_attachments(
162162
raise NotImplementedError
163163

164164
def get_all_work_items(
165-
self, query: str, fields: dict[str, str] | None = None
165+
self, query: str = "", fields: dict[str, str] | None = None
166166
) -> list[WorkItemType]:
167167
"""Get all work items matching the given query.
168168

polarion_rest_api_client/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ def create_work_item_attachments(
521521

522522
def get_work_items(
523523
self,
524-
query: str,
524+
query: str = "",
525525
fields: dict[str, str] | None = None,
526526
page_size: int = 100,
527527
page_number: int = 1,

0 commit comments

Comments
 (0)