@bdsqqq/lnr-cli 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/router/issues.ts +11 -0
package/package.json
CHANGED
package/src/router/issues.ts
CHANGED
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
createReaction,
|
|
22
22
|
deleteReaction,
|
|
23
23
|
createIssueRelation,
|
|
24
|
+
getProject,
|
|
24
25
|
type Issue,
|
|
25
26
|
type ListIssuesFilter,
|
|
26
27
|
type Comment,
|
|
@@ -65,6 +66,7 @@ const issueInput = z.object({
|
|
|
65
66
|
team: z.string().optional().describe("team key (required for new)"),
|
|
66
67
|
title: z.string().optional().describe("issue title (required for new)"),
|
|
67
68
|
description: z.string().optional().describe("issue description"),
|
|
69
|
+
project: z.string().optional().describe("project name to add issue to"),
|
|
68
70
|
comments: z.boolean().optional().describe("list comments on issue"),
|
|
69
71
|
editComment: z.string().optional().describe("comment id to edit (requires --text)"),
|
|
70
72
|
text: z.string().optional().describe("text for --edit-comment or --reply-to"),
|
|
@@ -462,6 +464,7 @@ async function handleCreateIssue(input: IssueInput): Promise<void> {
|
|
|
462
464
|
priority?: number;
|
|
463
465
|
labelIds?: string[];
|
|
464
466
|
parentId?: string;
|
|
467
|
+
projectId?: string;
|
|
465
468
|
} = {
|
|
466
469
|
teamId: team.id,
|
|
467
470
|
title: input.title,
|
|
@@ -509,6 +512,14 @@ async function handleCreateIssue(input: IssueInput): Promise<void> {
|
|
|
509
512
|
createPayload.parentId = parentIssue.id;
|
|
510
513
|
}
|
|
511
514
|
|
|
515
|
+
if (input.project) {
|
|
516
|
+
const project = await getProject(client, input.project);
|
|
517
|
+
if (!project) {
|
|
518
|
+
exitWithError(`project "${input.project}" not found`);
|
|
519
|
+
}
|
|
520
|
+
createPayload.projectId = project.id;
|
|
521
|
+
}
|
|
522
|
+
|
|
512
523
|
const issue = await createIssue(client, createPayload);
|
|
513
524
|
if (issue) {
|
|
514
525
|
console.log(`created ${issue.identifier}: ${issue.title}`);
|