feat(issue): add date filters to issue list

Description

glab mr list can filter by creation and update date, but glab issue list couldn't. Now it has the same four flags: --created-after, --created-before, --updated-after and --updated-before. glab incident list gets them too, because both commands share the same list code.

glab issue list --updated-after 2026-10-01T00:00:00Z
glab issue list --group my-group --created-after 2026-01-01T00:00:00Z --created-before 2026-02-01T00:00:00Z

Decisions, by their effect on users:

  1. This MR covers point 4 of the issue only. Relative values (like 7d) and date-only values (like 2026-10-01) will come in a follow-up MR, for issue list, mr list and ci list together.
  2. Values are RFC3339, the same format glab mr list --created-after takes. Anything else fails with an invalid time format error.
  3. The flags work with --group too, and with --epic. For --epic, glab checks the dates itself after fetching the epic's issues. There, a date equal to the bound counts as a match, and an issue with no date is left out.
  4. Like the other filters, the new flags count as a search. So an empty result prints No issues match your search in ... instead of the default message.

Related to #8593

How has this been tested?

I tested it by hand with a glab built from main and one built from this branch. I made read-only, anonymous calls to the public gitlab-org/cli project on gitlab.com, with a temporary config and no token.

Built from main:

$ glab issue list -R gitlab-org/cli --updated-after 2026-10-10T00:00:00Z
  Unknown flag: --updated-after.

Built from this branch:

$ glab issue list -R gitlab-org/cli --updated-after 2026-10-10T00:00:00Z --per-page 100 --output json | jq ...
8 issues, oldest updated_at: 2026-10-10T04:46:40.418Z

$ glab issue list -R gitlab-org/cli --all --created-after 2026-09-01T00:00:00Z --created-before 2026-09-08T00:00:00Z --per-page 100 --output json | jq ...
10 issues, created_at from 2026-09-01T16:11:10.924Z to 2026-09-07T18:04:26.112Z

$ glab issue list --group gitlab-org --created-after 2026-10-09T00:00:00Z --per-page 100 --output json | jq ...
100 issues, oldest created_at: 2026-10-09T17:54:15.559Z

$ glab issue list -R gitlab-org/cli --created-after 2026-10-01
  Invalid argument "2026-10-01" for "--created-after" flag: invalid time format `2026-10-01` must be one of: `2006-01-
  02T15:04:05Z07:00`.

Without the date flags, the same call returned a full page of 100 issues, created from 2026-08-04 to 2026-10-09. So the filter really narrows the list. I didn't try --epic by hand, so that part is only covered by the unit tests.

I added unit tests for the flags reaching the API (project and group), no flags, an invalid value, and each flag with --epic. Checks I ran:

$ go test -count=1 ./internal/commands/issuable/list/
ok  	gitlab.com/gitlab-org/cli/internal/commands/issuable/list	0.025s

gofmt -s -l and go vet printed nothing. The regenerated docs pages for issue list and incident list are in the commit. I didn't run make test, make lint or the docs linters locally, so I'm relying on the pipeline for those.

Screenshots (if appropriate):

Not applicable, there is no UI change.

Implemented with AI assistance; I reviewed and tested the changes.

Edited by Hamza Hassanain

Merge request reports

Loading
Loading