Skip to content

Commit 72c67c0

Browse files
committed
feat(issue-list): Add an option to filter by date
Fixes #1
1 parent 28e6109 commit 72c67c0

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/linear_cli/api/client/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,8 @@ async def get_issues(
387387
priority: int | None = None,
388388
limit: int = 50,
389389
after: str | None = None,
390+
created_after: str | None = None,
391+
created_before: str | None = None,
390392
order_by: str = "updatedAt",
391393
) -> dict[str, Any]:
392394
"""
@@ -430,6 +432,12 @@ async def get_issues(
430432
if priority is not None:
431433
filter_kwargs["priority"] = priority
432434

435+
if created_before is not None:
436+
filter_kwargs["created_before"] = created_before
437+
438+
if created_after is not None:
439+
filter_kwargs["created_after"] = created_after
440+
433441
issue_filter = build_issue_filter(**filter_kwargs) if filter_kwargs else None
434442

435443
variables = {

src/linear_cli/cli/commands/issue.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ async def get_issue_team_id(issue_id: str, client: Any) -> str:
329329
@click.option(
330330
"--limit", "-l", type=int, default=50, help="Maximum number of issues to show"
331331
)
332+
@click.option("--created-before", "-cb", help="Date until which to start looking for issues")
333+
@click.option("--created-after", "-ca", help="Date before which to start looking for issues")
332334
@click.pass_context
333335
def list(
334336
ctx: click.Context,
@@ -338,6 +340,8 @@ def list(
338340
labels: str,
339341
priority: str,
340342
limit: int,
343+
created_after: str,
344+
created_before: str,
341345
) -> None:
342346
"""
343347
List issues with optional filtering.
@@ -400,6 +404,8 @@ async def fetch_issues() -> dict[str, Any]:
400404
labels=label_list,
401405
priority=priority_int,
402406
limit=limit,
407+
created_before=created_before,
408+
created_after=created_after
403409
)
404410
return dict(issues_result) if isinstance(issues_result, dict) else {}
405411

0 commit comments

Comments
 (0)