feat(SITES-44690): add task-management controller (connections, tickets, Jira integration)#2802
Open
prithipalpatwal wants to merge 4 commits into
Open
feat(SITES-44690): add task-management controller (connections, tickets, Jira integration)#2802prithipalpatwal wants to merge 4 commits into
prithipalpatwal wants to merge 4 commits into
Conversation
…ts, Jira integration) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
prithipalpatwal
temporarily deployed
to
dev-branches
July 13, 2026 11:48 — with
GitHub Actions
Inactive
- listTicketsByOpportunity: post-filter by organizationId to prevent cross-org data leak - createTicket: fix idempotency key hash to always include organizationId explicitly - createTicket: only cache batch response as completed when all items succeed (partial failures remain retryable) - createTicket: add MIME type allowlist pre-check (aligned with jira-cloud-client) and filename sanitization - listIssueTypes: use queryStringParameters instead of rawQueryString - tests: update listIssueTypes fixture, add cross-org filter test, add MIME allowlist and filename tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
This PR will trigger a minor release when merged. |
…ggestionIds Both are always truthy; remove organizationId fallback. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
prithipalpatwal
temporarily deployed
to
dev-branches
July 13, 2026 12:20 — with
GitHub Actions
Inactive
…endpoints - Add shared IT test factory covering all 8 task-management endpoints (connections list/get, projects, issue-types, tickets list/get, ticket-by-suggestion, tickets-by-opportunity, create-ticket validation) - Add seed data: task_management_connections, tickets, ticket_suggestions - Register seeds at correct FK levels in seed.js - Add task-management-api.yaml with OpenAPI path definitions for all 8 endpoints - Add TaskManagementConnection, Ticket, TicketCreateRequest, TicketAttachment schemas to schemas.yaml - Wire task-management paths into api.yaml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Jira: SITES-44690
Summary
Adds the task-management controller and routes to spacecat-api-service (SITES-44690).
Access control
All endpoints verify IMS org membership via
AccessControlUtil.hasAccess(org)(v1 identity model per mysticat-architecture#150). Returns 404 on unknown org, 403 on denied. Admins bypass. readOnlyAdmin write-blocking handled upstream byreadOnlyAdminWrapper. S2S capability deferred to v2.Ticket creation (POST /organizations/:organizationId/task-management/:provider/tickets)
Flow:
Idempotency-Keyheader (required; 400 if absent). Checkidempotency_keystable — return cached response if completed, 409 if in-flight.TaskManagementConnectionbyconnectionIdfrom request body (404 if not found or not active for org+provider).TicketClientFactory.create()with the connection object,smClient(injected viasmClientWrappermiddleware), andhttpClient.JiraCloudClient(single, individual batch ≤15, or grouped ≤1500).Ticket+TicketSuggestionrecords.All routes
GET /organizations/:organizationId/task-management/connections— list connections (optional?provider=filter)GET /organizations/:organizationId/task-management/connections/:connectionId— get one connectionGET /organizations/:organizationId/task-management/connections/:connectionId/projects— list Jira projectsGET /organizations/:organizationId/task-management/connections/:connectionId/issue-types?projectId=— list Jira issue types for a projectGET /organizations/:organizationId/task-management/tickets— list tickets for orgGET /organizations/:organizationId/suggestions/:suggestionId/ticket— get ticket for suggestionGET /organizations/:organizationId/opportunities/:opportunityId/tickets— list tickets for opportunityPOST /organizations/:organizationId/task-management/:provider/tickets— create ticket(s)v1 scope notes
suggestionIdsoptional;opportunityIdcan be used directly without suggestions.priority,dueDate,components,parentforwarded to Jira if provided (optional fields per spec).SecretsManagerClientinjected viasmClientWrappermiddleware (follows thes3ClientWrapperpattern insrc/support/s3.js).connectionIdin request body; resolved vialoadConnectionForOrg().connectionIdandproviderclassified asFACS_NON_RESOURCE_PARAMS— JWT session only, not a FACS surface in v1. ReBAC deferred to v2.