BJ-9: Add JiraService — issue-oriented Jira Cloud API surface#
Problem#
The AgentSDE pipeline needs a service to interact with Jira Cloud issues (comments, transitions, labels, assignee, priority, links, search). Without it, Jira-backed projects cannot be automated end-to-end.
Task / Link#
Closes #549
Changes#
- Add
JiraServicewith 11 issue-oriented methods backed by Jira Cloud REST v3:postComment,editComment,transitionIssue,getTransitions,addLabel,removeLabel,setAssignee,setPriority,linkIssues,searchJql,getIssue - Private
request()helper attachesAuthorization: Bearer <token>fromJIRA_AUTH_PROVIDER; retries once on 401 (token refresh) and once on 429 (honouringRetry-After) - Add
JiraModulewith factory providers forJIRA_AUTH_PROVIDER(stub until Atlassian OAuth lands) andJIRA_SERVICE - Register
JiraModuleinAppModule - Add
JIRA_CLOUD_ID(optional) to config schema,.env.example, andCLAUDE.md - 24 unit tests covering all methods, 429 retry, 401 refresh, missing-config error, and empty-result paths
Notes#
JIRA_AUTH_PROVIDERis a stub (returnsnull) until the Atlassian OAuth module (BJ-3/4/5) lands; bothJIRA_AUTH_PROVIDERandJIRA_SERVICEwill benulluntil then — consumers must treat Jira support as optionalJIRA_CLOUD_IDis made optional in the config schema (notrequired()) to allow startup without Jira credentials
Testing#
- 24 unit tests in
src/jira/jira.service.spec.ts— all pass npm run lint— zero warnings