diff --git a/src/pm/linear/adapter.ts b/src/pm/linear/adapter.ts index 04be22b3..e90f237f 100644 --- a/src/pm/linear/adapter.ts +++ b/src/pm/linear/adapter.ts @@ -227,6 +227,7 @@ export class LinearPMProvider implements PMProvider { await linearClient.createIssue({ teamId: this.config.teamId, ...(this.config.projectId ? { projectId: this.config.projectId } : {}), + ...(this.config.statuses?.backlog ? { stateId: this.config.statuses.backlog } : {}), title: name, description, parentId, diff --git a/tests/unit/pm/linear/adapter.test.ts b/tests/unit/pm/linear/adapter.test.ts index dcee1d70..4d0bfd99 100644 --- a/tests/unit/pm/linear/adapter.test.ts +++ b/tests/unit/pm/linear/adapter.test.ts @@ -396,6 +396,16 @@ describe('LinearPMProvider', () => { ); }); + it('passes stateId for backlog on sub-issue creation', async () => { + mockCreateIssue.mockResolvedValue(makeIssue()); + + await provider.addChecklistItem('subtasks-issue-uuid', 'Sub-task 1'); + + expect(mockCreateIssue).toHaveBeenCalledWith( + expect.objectContaining({ stateId: 'state-backlog' }), + ); + }); + it('throws when checklistId has no extractable parent', async () => { await expect(provider.addChecklistItem('invalid-id', 'Sub-task')).rejects.toThrow( 'Cannot extract parent issue ID from checklist ID: invalid-id',