-
Notifications
You must be signed in to change notification settings - Fork 5
support to fliter issues and tickets based on child parts #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,7 +121,20 @@ async def handle_list_tools() -> list[types.Tool]: | |
"required": ["next_cursor", "mode"], | ||
"description": "The cursor to use for pagination. If not provided, iteration begins from the first page. In the output you get next_cursor, use it and the correct mode to get the next or previous page. You can use these to loop through all the pages." | ||
}, | ||
"applies_to_part": {"type": "array", "items": {"type": "string"}, "description": "The part IDs of the works to list"}, | ||
"limit": {"type": "integer", "description": "The maximum number of works to return. Unless specified, keep the limit 10."}, | ||
"applies_to_part": { | ||
"type": "object", | ||
"properties": { | ||
"parts": { | ||
"type": "array", | ||
"items": {"type": "string"}, | ||
"description": "The part IDs of the works to list" | ||
}, | ||
"include_child_parts": {"type": "boolean", "description": "Whether to include child parts in the list of parts to list works for."} | ||
}, | ||
"required": ["parts", "include_child_parts"], | ||
"description": "The parts to list works for. If include_child_parts is true, the child parts of the parts will also be included in the list." | ||
}, | ||
"created_by": {"type": "array", "items": {"type": "string"}, "description": "The user IDs of the creators of the works to list"}, | ||
"owned_by": {"type": "array", "items": {"type": "string"}, "description": "The user IDs of the owners of the works to list"}, | ||
"state": {"type": "array", "items": {"type": "string", "enum": ["open", "closed", "in_progress"]}, "description": "The state names of the works to list"}, | ||
|
@@ -196,7 +209,7 @@ async def handle_list_tools() -> list[types.Tool]: | |
"description": "Use this to filter on sprints." | ||
} | ||
}, | ||
"required": ["type"], | ||
"required": ["type", "limit"], | ||
}, | ||
), | ||
types.Tool( | ||
|
@@ -677,14 +690,21 @@ async def handle_call_tool( | |
raise ValueError("Missing type parameter") | ||
payload["type"] = type | ||
|
||
limit = arguments.get("limit") | ||
if limit: | ||
payload["limit"] = limit | ||
|
||
cursor = arguments.get("cursor") | ||
if cursor: | ||
payload["cursor"] = cursor["next_cursor"] | ||
payload["mode"] = cursor["mode"] | ||
|
||
applies_to_part = arguments.get("applies_to_part") | ||
if applies_to_part: | ||
payload["applies_to_part"] = applies_to_part | ||
if 'ticket' in type: | ||
payload["ticket"]["applies_to_part"] = applies_to_part | ||
elif 'issue' in type: | ||
payload["issue"]["applies_to_part"] = applies_to_part | ||
|
||
created_by = arguments.get("created_by") | ||
if created_by: | ||
|
@@ -754,7 +774,7 @@ async def handle_call_tool( | |
if payload["ticket"] == {}: | ||
payload.pop("ticket") | ||
|
||
response = make_devrev_request( | ||
response = make_internal_devrev_request( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is support for filtering on child parts not exposed in the public API? If not, we should add it, should be quick. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, let's expose it in the public API and minimise internal API calls here. |
||
"works.list", | ||
payload | ||
) | ||
|
Uh oh!
There was an error while loading. Please reload this page.