feat(incidents): expose nums (short id) filter on query_incidents#63
Merged
Conversation
query_incidents could only resolve a short incident id (the 6-char "num" shown in the UI) implicitly via the free-text `query` field. Add an explicit `nums` parameter that maps to ListIncidentsRequest.Nums, mirroring the `fduty incident list --nums` CLI flag. Like the other list filters it is matched within the since/until window; the backend caps the list span at ~30 days, so incidents older than that must be looked up by their full incident_id (documented in the param help).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
query_incidentscould only resolve a short incident id (the 6-char num shown in the UI, e.g.311510) implicitly via the free-textqueryfield. There was no first-class way to filter by short id, mirroring the gap just fixed in thefdutyCLI (flashduty-cli#26).What
Add an explicit
numsparameter (comma-separated) that maps toListIncidentsRequest.Nums, mirroringfduty incident list --nums.Like the other list filters it is matched within the
since/untilwindow; the backend caps the list span at ~30 days, so incidents older than that must be looked up by their fullincident_id— documented in the param help. (Direct full-id lookups still use theincident_ids→/incident/list-by-idspath, which is time-window-free.)Verification
go build ./...,go vet, fullgo test ./...— green;gofmtclean.TestQueryIncidentsNumsReachesWireassertsnumsis split and sent as thenumsarray to/incident/listwithin the time window (httptest stub).query_incidentsis not in__toolsnaps__).