Commit 5e18c48aa596

Vincent Demeester <vincent@sbr.pm>
2026-03-17 17:59:25
fix(jira): resolve link type errors and broken epic linking
Added link type alias mapping to auto-correct relationship labels (e.g. "relates to" → "Related") that the LLM would pass but jira-cli rejected. Fixed epic linking to use -P flag instead of non-existent --epic. Added pi-coding-agent devDependency and relaxed tsconfig to match working extensions.
1 parent b1ae5ca
dots/pi/agent/extensions/jira/epic-actions.ts
@@ -106,8 +106,8 @@ export async function handleLinkToEpic(
 
 	onUpdate?.({ content: [{ type: "text", text: `Linking ${params.issue} to epic ${params.epic}...` }] });
 
-	// Link issue to epic using edit command
-	const result = await pi.exec("jira", ["issue", "edit", params.issue, "--epic", params.epic], {
+	// Link issue to epic using edit command with --parent flag
+	const result = await pi.exec("jira", ["issue", "edit", params.issue, "-P", params.epic, "--no-input"], {
 		signal,
 		timeout: 20000,
 	});
dots/pi/agent/extensions/jira/index.ts
@@ -244,7 +244,7 @@ export default function (pi: ExtensionAPI) {
 			),
 			linkType: Type.Optional(
 				Type.String({
-					description: "Link type: blocks, is blocked by, relates to, duplicates, is duplicated by",
+					description: "Link type name (case-insensitive): Blocks, Related, Duplicate, Cloners, Depend, Causality, Document, Incorporates, Informs, Triggers",
 				}),
 			),
 
dots/pi/agent/extensions/jira/package.json
@@ -3,9 +3,10 @@
   "version": "1.0.0",
   "type": "module",
   "scripts": {
-    "test": "bun test test.ts"
+    "test": "bun test jira.test.ts"
   },
   "devDependencies": {
+    "@mariozechner/pi-coding-agent": "*",
     "bun-types": "^1.0.0"
   }
 }
dots/pi/agent/extensions/jira/tsconfig.json
@@ -1,13 +1,13 @@
 {
   "compilerOptions": {
-    "target": "ESNext",
-    "module": "ESNext",
+    "types": ["bun-types"],
+    "module": "esnext",
     "moduleResolution": "bundler",
+    "target": "esnext",
+    "strict": false,
+    "noImplicitAny": false,
     "esModuleInterop": true,
-    "strict": true,
-    "skipLibCheck": true,
-    "noEmit": true,
-    "types": ["bun-types"]
+    "skipLibCheck": true
   },
   "include": ["*.ts"]
 }
dots/pi/agent/extensions/jira/types.ts
@@ -88,7 +88,7 @@ export interface JiraLinkParams {
 	action: "link";
 	from: string;
 	to: string;
-	linkType: "blocks" | "is blocked by" | "relates to" | "duplicates" | "is duplicated by";
+	linkType: string; // Valid Jira link type names: Blocks, Related, Duplicate, Cloners, Depend, etc.
 }
 
 export interface JiraUnlinkParams {