fix(tickets): correct filter field names and value shapes for list()#16
Merged
Conversation
NinjaOne's ticket filter API rejects the enum string for status and the field name `organizationId`, returning 400 for any filtered list call. - status: map TicketStatus enum to numeric parent statusId (NEW=1000, OPEN=2000, WAITING=3000, CLOSED=6000 confirmed via live tenant; IN_PROGRESS=4000, RESOLVED=5000, ON_HOLD=7000 inferred from the 1000-stride pattern) - organizationId: send as field `clientId` to match the ticket schema - types: clarify that boardId default of 1 isn't guaranteed across tenants Adds regression tests that capture the outgoing request body and assert field names + value shapes. Closes #15
Merged
4 tasks
asachs01
added a commit
to wyre-technology/ninjaone-mcp
that referenced
this pull request
May 28, 2026
Picks up the tickets filter-builder fix from wyre-technology/node-ninjaone#16 — status enum now maps to numeric parent statusId, organizationId filter sends as `clientId`. Filtered ticket list calls will stop returning 400 from NinjaOne.
asachs01
added a commit
to wyre-technology/ninjaone-mcp
that referenced
this pull request
May 28, 2026
* fix(tickets): forward cursor as lastCursorId so pagination works The tickets_list handler read args.cursor into a local variable, logged it, then dropped it on the floor — every call returned page 1 regardless of the cursor passed in. Forward it to the SDK as lastCursorId (number), matching the SDK's parameter shape. Closes #31 * feat(tickets): add ninjaone_tickets_boards_list tool Surfaces the SDK's listBoards() so callers can discover board_id values without trial-and-error or scraping URLs from the NinjaOne web UI. Refs #31 (related-gap section) * chore(deps): bump @wyre-technology/node-ninjaone to ^1.1.2 Picks up the tickets filter-builder fix from wyre-technology/node-ninjaone#16 — status enum now maps to numeric parent statusId, organizationId filter sends as `clientId`. Filtered ticket list calls will stop returning 400 from NinjaOne.
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.
Summary
tickets.list()filter builder used wrong field names / value shapes — every filtered call 400dstatus: enum string → numeric parentstatusIdvia lookup tableorganizationId: field name →clientId(matches ticket schema)boardIddefault of 1 isn't guaranteed per tenantCloses #15
Test plan
npm test— 85/85 pass (added 3 regression tests asserting outgoing request body shape)npm run build— cleantickets.list({ boardId: 2, status: 'OPEN' })returns rows instead of 400Notes
Status IDs 4000/5000/7000 are inferred from the 1000-stride pattern. If a tenant uses different IDs for those system statuses, the filter would silently match nothing. Worth verifying before depending on it in production.