Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/server/utils/evaluateIssue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,10 @@ Please provide your evaluation in the following JSON format:

return evaluation;
}

export async function evaluateJiraIssue(
title: string,
description: string,
): Promise<{ score: number; feedback?: string }> {
const systemPrompt = `You are an expert issue evaluator. Assess the following Jira issue based on its title and description. Provide a confidence score between 1 and 5 indicating how likely it is that an AI coding agent can flawlessly complete the task. If the score is less than 4, provide a one-sentence feedback message explaining what needs to be changed to make the ticket actionable by JACoB.`;
}
17 changes: 17 additions & 0 deletions src/server/utils/jira.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,23 @@ export async function fetchNewJiraIssues({

const owner = project.repoFullName.split("/")[0];
const repo = project.repoFullName.split("/")[1];

const evaluation = await evaluateJiraIssue(
issue.title,
issue.description,
);
if (evaluation.score < 4) {
await db.issues.find(issue.id).update({
evaluationScore: evaluation.score,
evaluationFeedback: evaluation.feedback,
status: "rejected",
});
console.log(
`Skipped creating GitHub issue for Jira issue ${issue.id} due to low evaluation score.`,
);
continue;
}

if (!owner || !repo) {
throw new Error("Invalid repo full name");
}
Expand Down