1.2 KiB
<%* // --- User Prompts --- const bugTitle = await tp.system.prompt("Enter Bug Name / Title"); if (!bugTitle) { // If the user cancels the prompt, abort the mission. return; }
const projectName = await tp.system.prompt("Which Project does this bug belong to?");
// --- File & Folder Configuration ---
const folder = "Bugs";
const fileName = BUG - ${bugTitle};
const filePath = ${folder}/${fileName}.md;
// --- Dynamic Content Generation (CORRECTED) --- // We build the entire string using ONLY JavaScript template literal syntax. const content = `--- tags:
- bug
- ${projectName ? projectName.toLowerCase().replace(/\s+/g, '-') : "untagged"} status: Open creation_date: ${tp.date.now("YYYY-MM-DD")}
BUG: ${bugTitle}
Project: ${projectName ? [[Projects/${projectName}/00_${projectName.replace(/\s+/g, "_")}|${projectName}]] : "N/A"}
Description
Troubleshooting Steps:
Implemented Solution
Root Cause & Lesson Learned:
`;
// --- Execution --- // Create the new file with the dynamically generated content. const newFile = await app.vault.create(filePath, content);
// Open the newly created file for immediate editing. app.workspace.openLinkText(newFile.path, "", false); %>